本文整理汇总了PHP中Assets类的典型用法代码示例。如果您正苦于以下问题:PHP Assets类的具体用法?PHP Assets怎么用?PHP Assets使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Assets类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: parseAssets
public function parseAssets($rowset, $characterID, $containerID)
{
//echo "Working on container: $containerID <br>";
foreach ($rowset as $item) {
if ($item->count() > 0) {
//echo "Triggered next nest. Count = {$rowset->count()} <br>";
$this->parseAssets($item->rowset->row, $characterID, $item->attributes()->itemID);
}
if (isset($item->attributes()->locationID)) {
$locationName = $this->getLocationName($item->attributes()->locationID);
}
$invType = Invtypes::Model()->findByPk($item->attributes()->typeID);
$asset = new Assets();
$asset->characterID = $characterID;
$asset->itemID = $item->attributes()->itemID;
$asset->locationID = $item->attributes()->locationID;
$asset->typeID = $item->attributes()->typeID;
$asset->quantity = $item->attributes()->quantity;
$asset->flag = $item->attributes()->flag;
$asset->singleton = $item->attributes()->singleton;
$asset->containerID = $containerID;
$asset->locationName = $locationName;
$asset->typeName = $invType->typeName;
$asset->groupID = $invType->groupID;
try {
$asset->save();
//echo "Item: {$asset->itemID} {$asset->typeName} Character: {$asset->characterID} Container: {$asset->containerID} <br>";
} catch (Exception $e) {
//echo "ERROR: Item {$asset->itemID} <br>";
//echo "Item: {$asset->itemID} {$asset->typeName} Character: {$asset->characterID} Container: {$asset->containerID} <br>";
//$message = $e->getMessage();
//echo "Exception: $message <br>";
}
}
}
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:35,代码来源:APIAssetList.php
示例2: resource
function resource($file, $level = '', $display = 'url', $params = '')
{
include_once APPPATH . 'libraries/Assets.php';
$assets = new Assets();
if ($display === 'url') {
return $assets->url($file, $level);
} elseif ($display === 'file') {
return $assets->load($file, $level, $params);
} else {
return $assets->url($file, $level);
}
}
开发者ID:sdgdsffdsfff,项目名称:hiveAdmin,代码行数:12,代码来源:template_helper.php
示例3: show
public function show($options = array(), $data)
{
// dump($data);die;
$name = $data['field_name'];
$path = site_url("admin/" . $data['options']->path . "/ajax_execute/order_box");
$js = <<<EOT
\t\t\t\$(".order_box").change(function(){
\t\t\t\tdata_send = {
\t\t\t\t\t"field_name" : \$(this).attr("order_box_field"),
\t\t\t\t\t"pk"\t\t: \$(this).attr("order_box_pk"),
\t\t\t\t\t"pk_val"\t : \$(this).attr("order_box_id"),
\t\t\t\t\t"value"\t : \$(this).val()
\t\t\t\t};
\t\t\t\t\$.getJSON('{$path}', data_send, function(data) {
\t\t\t\t\t // alert(JSON.stringify(data));
\t\t\t\t});
\t\t\t});
\t\t\t\t\t
EOT;
Assets::add_js($js, "inline", true);
// dump($data);die;
return "<input class='order_box' name='' value='{$data['value']}' order_box_id='{$data['pk']}' min='0' max='99' order_box_pk='{$data['pk_name']}' order_box_field='{$data['field_name']}' type='number' style='max-width: 30px;' />";
}
开发者ID:caina,项目名称:pando,代码行数:25,代码来源:order_box.php
示例4: test_inline
public function test_inline()
{
$assets = Assets::factory('test_name')->process(FALSE)->css('test.css')->js('test.js');
$inline = $assets->inline();
$this->assertContains('.test { display: block; }', $inline);
$this->assertContains('var test;', $inline);
}
开发者ID:alle,项目名称:assets-merger,代码行数:7,代码来源:TestAssets.php
示例5: enqueue_manage_post_assets
function enqueue_manage_post_assets()
{
$WP = \EzFilter\getWpObject();
$post_types = $WP->getSettings('post_types');
if (!in_array($WP->typenow, $post_types)) {
return false;
}
$assetsToEnqueue = array();
$remove_default = $WP->removeDefaultFilter();
$post_type_settings = $WP->getSettings($WP->typenow);
$post_type_settings = isset($post_type_settings['config']) ? $post_type_settings['config'] : array();
if (in_array('date_range', $post_type_settings)) {
$assetsToEnqueue['css'][$WP->plugin_domain . "-post-css"] = $WP->plugin_domain . "-post-css";
$assetsToEnqueue['css']['jquery-style'] = 'jquery-style';
$assetsToEnqueue['js']['jquery'] = 'jquery';
$assetsToEnqueue['js']['jquery-ui-core'] = 'jquery-ui-core';
$assetsToEnqueue['js']['jquery-ui-datepicker'] = 'jquery-ui-datepicker';
$assetsToEnqueue['js'][$WP->plugin_domain . "-post-js"] = $WP->plugin_domain . "-post-js";
}
if ($remove_default) {
$assetsToEnqueue['css'][$WP->plugin_domain . "-post-css"] = $WP->plugin_domain . "-post-css";
$assetsToEnqueue['js']['jquery'] = 'jquery';
$assetsToEnqueue['js'][$WP->plugin_domain . "-post-js"] = $WP->plugin_domain . "-post-js";
}
Assets::enqueue_assets($assetsToEnqueue);
return true;
}
开发者ID:ronisaha,项目名称:easy-filter,代码行数:27,代码来源:Admin.php
示例6: index
public function index(array $params = [])
{
Assets::addCSS('svgtree-0.3.0.min.css');
Assets::addCSS('main.css');
Assets::addJS('jsrender.min.js');
Assets::addJS('db.js');
Assets::addJS('main.js');
Assets::addJS('search.js');
Assets::addJS('svgtree-0.3.0.min.js');
Assets::addJS('trees.js');
$this->SearchModel = $this->loader->loadModel('Search');
if (isset($_POST['words'])) {
$words = json_decode($_POST['words']);
$results = $this->SearchModel->searchFromKeywords($words);
$response = [];
// if we have some results to handle
if ($results) {
// count values
$results = array_count_values($results);
// sort by count
arsort($results);
// keep only sorted links id
$results = array_keys($results);
foreach ($results as $linkId) {
$link = $this->SearchModel->getLink($linkId);
if ($link) {
$response[] = $link;
}
}
}
echo json_encode($response);
exit;
}
$this->loader->loadView('index', $this->data, true);
}
开发者ID:cocochepeau,项目名称:si-dev,代码行数:35,代码来源:IndexController.php
示例7: create_form
public function create_form($fields_data = false)
{
$this->table_structure = $this->get_table_structure();
Assets::add_js("jasny-bootstrap.min.js");
Assets::add_js("modernizr-2.5.3.js");
Assets::add_css("jasny-bootstrap.min.css");
$hiddens = array();
//hiddens only on update
if ($fields_data !== FALSE) {
$primary_key = $this->get_primary_key();
$hiddens = array($primary_key => $fields_data->{$primary_key});
}
$form = "";
$form .= form_open_multipart($this->ci->uri->uri_string(), 'class="form-horizontal" name="form_upload"', $hiddens);
foreach ($this->table_structure as $field_info) {
if ($this->can_show_input($field_info)) {
$form .= $this->generate_input($field_info, $fields_data);
}
}
// AFTER CREATE THE FORM, WE WILL INSERT HERE THE COMPONENTS
if (isset($this->config->components)) {
foreach ($this->config->components as $component_name => $component_configurations) {
$component_configurations = $this->get_default_config($component_configurations);
$component_lib = $this->ci->load->library("components/{$component_name}", $component_configurations);
$form .= $component_lib->generate();
}
}
$cancel_link = anchor(SITE_AREA . $this->get_path(), "Cancelar", "class='btn btn-warning'");
$form .= "\n\t\t <fieldset>\n\t\t <div class='form-actions'>\n\t\t <br/>\n\t\t <input type='submit' name='save' class='btn btn-success' value='Salvar' />\n\t\t <input type='submit' name='save' class='btn btn-success' value='Salvar e continuar' />\n\t\t <!--<input type='submit' name='draft' class='btn btn-primary' value='Rascunho' />-->\n\t\t {$cancel_link}\n\t\t </div>\n\t\t </fieldset>\n\t\t";
$form .= form_close();
return $form;
}
开发者ID:caina,项目名称:pando,代码行数:32,代码来源:dynamic_creator.php
示例8: __construct
/**
* Create an instance of this class by using a plain PHP array.
*
* @param array $conf an array containing the configuration
* settings
* @param string $path the path to the config file that was used
* (NULL if instantiated via constructor)
*/
function __construct($conf = array(), $path = NULL)
{
global $ABSOLUTE_PATH_STUDIP;
$defaults = array('assets_root' => "{$ABSOLUTE_PATH_STUDIP}assets", 'package_path' => "{$ABSOLUTE_PATH_STUDIP}assets/squeezed", 'package_url' => \Assets::url('squeezed'), 'javascripts' => array(), 'compress' => true, 'compressor_options' => array());
$this->settings = array_merge($defaults, $conf);
$this->settings['config_path'] = $path ?: __FILE__;
}
开发者ID:ratbird,项目名称:hope,代码行数:15,代码来源:Configuration.php
示例9: actionStoreValue
public function actionStoreValue()
{
$id = $_GET['id'];
$asset = Assets::Model()->findByPk($id);
$this->storeSingleAssetValue($asset->typeID);
$this->renderPartial('storeValue');
}
开发者ID:Covert-Inferno,项目名称:prohd,代码行数:7,代码来源:AssetsController.php
示例10: __construct
public function __construct()
{
parent::__construct();
// Set default javascript
$this->template->append_metadata(Assets::adminJs('main', 'js'));
// Show login page
$current_page = $this->uri->segment(1, '') . '/' . $this->uri->segment(2, 'index');
if (!$this->ion_auth->logged_in()) {
if ($current_page != 'admin/login') {
redirect('admin/login');
}
}
//Set theme for backend
$this->template->set_partial('sidebar', 'admin/sidebar')->set_partial('head', 'admin/head')->enable_parser(FALSE)->set_layout('main', 'admin');
// Check access
$currentModule = $this->router->fetch_module();
$accessGranted = $this->ion_auth->check_access(get_module_id($currentModule), 'admin');
if ($this->ion_auth->logged_in() && !$accessGranted) {
// Allow access to dashboard
$this->session->set_flashdata('access_error', 'You don\'t have access to this module!');
if ($current_page != 'admin/index') {
redirect('admin');
}
}
}
开发者ID:karlomikus,项目名称:CometCI,代码行数:25,代码来源:Backend_Controller.php
示例11: st_vc_about_icon
function st_vc_about_icon($attr, $content = false)
{
$data = shortcode_atts(array('st_icon' => '', 'st_name' => '', 'st_description' => '', 'st_link' => '', 'st_pos_icon' => 'top', 'st_color_icon' => '', 'st_size_icon' => 'box-icon-sm', 'st_text_align' => 'text-center', 'st_border' => '', 'st_to_color' => 'black'), $attr, 'st_about_icon');
extract($data);
$icons_center = '';
if ($st_text_align == 'text-center') {
$icons_center = 'box-icon-center';
}
$class_bg_color = Assets::build_css("background: " . $st_color_icon . "");
if (!empty($st_border)) {
$class_bg_color = Assets::build_css("border-color: " . $st_color_icon . "!important;\r\n color: " . $st_color_icon . "!important;");
}
if (empty($st_link)) {
$title = '<h4 class="thumb-title">' . $st_name . '</h4>';
} else {
$title = ' <h5 class="thumb-title">
<a href="' . $st_link . '" class="text-darken">' . $st_name . '</a>
</h5>';
}
$txt = '
<div class="thumb ' . $st_text_align . '">
<header class="thumb-header pull-' . $st_pos_icon . ' st-thumb-header">
<i class="fa ' . $st_icon . ' ' . $st_size_icon . ' box-icon-' . $st_pos_icon . ' ' . $icons_center . ' round ' . $class_bg_color . ' animate-icon-top-to-bottom ' . $st_border . ' box-icon-to-' . $st_to_color . ' "></i>
</header>
<div class="thumb-caption pull-' . $st_pos_icon . ' st-thumb-caption">
' . $title . '
<p class="thumb-desc">' . $st_description . '</p>
</div>
</div>
';
return $txt;
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:32,代码来源:st-about-icon.php
示例12: index
public function index()
{
$offset = $this->uri->segment(4);
Assets::add_js($this->load->view('settings/users_js', null, true), 'inline');
$total_users = $this->user_model->count_all();
$this->pager['base_url'] = site_url(SITE_AREA . '/settings/users/index');
$this->pager['total_rows'] = $total_users;
$this->pager['per_page'] = $this->limit;
$this->pager['uri_segment'] = 4;
$this->pagination->initialize($this->pager);
// Was a filter set?
if ($this->input->post('filter_submit') && $this->input->post('filter_by_role_id')) {
$role_id = $this->input->post('filter_by_role_id');
$this->db->where('role_id', $role_id);
Template::set('filter', $role_id);
}
if (config_item('auth.use_usernames')) {
$this->db->order_by('username', 'asc');
} else {
$this->db->order_by('email', 'asc');
}
Template::set('users', $this->user_model->limit($this->limit, $offset)->find_all());
Template::set('total_users', $total_users);
Template::set('deleted_users', $this->user_model->count_all(true));
Template::set('roles', $this->role_model->select('role_id, role_name, default')->find_all());
Template::set('user_count', $this->user_model->count_all());
Template::set('login_attempts', $this->user_model->get_login_attempts($this->limit));
$this->load->helper('ui/ui');
Template::set('toolbar_title', lang('us_user_management'));
Template::render();
}
开发者ID:nurulimamnotes,项目名称:Bonfire,代码行数:31,代码来源:settings.php
示例13: render
public function render()
{
$asset = Assets::get();
$this->addData(['css' => $asset->Css(), 'js' => $asset->Js(), 'internalCss' => $asset->InternalCss(), 'jsReady' => $asset->OnLoadJs()]);
$tpl = Template::get()->loadTemplate($this->template);
return $tpl->render($this->data);
}
开发者ID:balucio,项目名称:smac,代码行数:7,代码来源:main.php
示例14: create
/**
* Create a Groups object.
*
* @return void
*/
public function create()
{
$this->load->config('address');
$this->load->helper('address');
if (isset($_POST['save'])) {
if ($insert_id = $this->save_groups()) {
log_activity($this->auth->user_id(), lang('groups_act_create_record') . ': ' . $insert_id . ' : ' . $this->input->ip_address(), 'groups');
Template::set_message(lang('groups_create_success'), 'success');
redirect('/');
}
// Not validation error
if (!empty($this->groups_model->error)) {
Template::set_message(lang('groups_create_failure') . $this->groups_model->error, 'error');
}
}
if ($this->siteSettings['auth.password_show_labels'] == 1) {
Assets::add_js($this->load->view('users_js', array('settings' => $this->siteSettings), true), 'inline');
}
// Generate password hint messages.
$this->user_model->password_hints();
$result = array();
$group_type_options = $this->group_types_model->get_group_types_list();
array_unshift($group_type_options, "Select");
Template::set('group_type_options', $group_type_options);
Template::set('toolbar_title', lang('groups_action_create'));
Template::set_view('content/create', $result);
Template::render();
}
开发者ID:ras-org,项目名称:ras,代码行数:33,代码来源:groups.php
示例15: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->model('botan_structure/botan_structure_model');
$this->lang->load('botan_structure');
Assets::add_module_js('botan_structure', 'botan_structure.js');
}
开发者ID:brkrishna,项目名称:freelance,代码行数:12,代码来源:botan_structure.php
示例16: st_vc_icon
function st_vc_icon($attr, $content = false)
{
$data = shortcode_atts(array('st_tooltip' => '', 'st_pos_tooltip' => 'none', 'st_icon' => '', 'st_color_icon' => '', 'st_to_color' => '', 'st_size_icon' => 'box-icon-sm', 'st_round' => '', 'st_border' => '', 'st_animation' => '', 'st_aligment' => 'box-icon-none'), $attr, 'st_about_icon');
extract($data);
$class_bg_color = Assets::build_css("background: " . $st_color_icon . "");
$class_bg_to_color = Assets::build_css("background: " . $st_to_color . ";\r\n border-color: " . $st_to_color . ";\r\n ", ":hover");
if ($st_animation == "border-rise") {
$class__ = Assets::build_css("box-shadow: 0 0 0 2px " . $st_to_color . " ", ":after");
$class_bg_to_color = $class_bg_to_color . " " . $class__;
}
if (!empty($st_border)) {
$class_bg_color = Assets::build_css("border-color: " . $st_color_icon . ";\r\n color: " . $st_color_icon . ";");
}
if (!$st_pos_tooltip or $st_pos_tooltip != 'none') {
$html_tooltip = 'data-placement="' . $st_pos_tooltip . '" title="" rel="tooltip" data-original-title="' . $st_tooltip . '"';
} else {
$html_tooltip = "";
}
if (!empty($st_animation)) {
$animate = "animate-icon-" . $st_animation;
} else {
$animate = "";
}
$txt = '<i class="fa ' . $st_icon . ' ' . $st_size_icon . ' ' . $st_border . ' ' . $st_aligment . ' ' . $class_bg_color . ' ' . $st_round . ' ' . $class_bg_to_color . ' ' . $animate . ' " ' . $html_tooltip . '> </i>';
return $txt;
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:26,代码来源:st-icon.php
示例17: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict($this->permissionSiteReportsView);
$this->auth->restrict($this->permissionViewActivities);
$this->lang->load('activities/activities');
$this->lang->load('datatable');
$this->load->model('activities/activity_model');
Assets::add_js(array('bootstrap', 'jquery.dataTables', 'bootstrap-dataTables'));
Assets::add_js($this->load->view('reports/activities_js', null, true), 'inline');
Assets::add_css(array('datatable', 'bootstrap-dataTables'));
// Check the permissions, store the results.
$this->hasPermissionDeleteOwn = $this->auth->has_permission($this->permissionDeleteOwn);
$this->hasPermissionViewDate = $this->auth->has_permission($this->permissionViewDate);
$this->hasPermissionViewModule = $this->auth->has_permission($this->permissionViewModule);
$this->hasPermissionViewOwn = $this->auth->has_permission($this->permissionViewOwn);
$this->hasPermissionViewUser = $this->auth->has_permission($this->permissionViewUser);
if ($this->hasPermissionViewUser || $this->hasPermissionViewModule || $this->hasPermissionViewDate) {
Template::set_block('sub_nav', 'reports/_sub_nav');
}
Template::set('toolbar_title', lang('activities_title'));
Template::set('hasPermissionDeleteOwn', $this->hasPermissionDeleteOwn);
Template::set('hasPermissionViewDate', $this->hasPermissionViewDate);
Template::set('hasPermissionViewModule', $this->hasPermissionViewModule);
Template::set('hasPermissionViewOwn', $this->hasPermissionViewOwn);
Template::set('hasPermissionViewUser', $this->hasPermissionViewUser);
}
开发者ID:ivantcholakov,项目名称:Bonfire,代码行数:32,代码来源:Reports.php
示例18: index
/**
* show map
*
* @param string $id
* @return void
* @author Andy Bennett
*/
public function index($id = 1)
{
$db = new Database();
$m = ORM::factory('imagemap', $id);
if (!$m->loaded) {
Kohana::show_404('Imagemap ' . $id, 'common/error_404');
return;
}
Assets::instance()->add_javascript('/cache/js/photonotes');
Assets::instance()->add_css('/cache/css/photonotes');
Assets::instance()->add_css('/cache/css/photonotes_client');
$pages_array = strstr(APPPATH, 'backend_') === FALSE ? array() : imagemap_helper::get_pages();
$pages = json_encode($pages_array);
// Build the Image object
$image = array();
$image['img'] = $m->upload->id . $m->upload->file_ext;
$image['alt'] = $m->title;
// Load the view as an object
$view = new View('imagemap');
// Add variable data to the view
$view->image = $image;
$view->notes = $m->imagenotes;
$view->admin = true;
//APPENV == 'backend'; // Are the image maps editable?
$view->id = $id;
// Needed for reporting changes back to the backend via ajax
$view->pages = $pages;
// Send the array of pages through to the view
// Render the View
$view->render(TRUE);
}
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:38,代码来源:Imagemap.php
示例19: action_index
public function action_index()
{
Assets::package('jquery-ui');
$cur_ds_id = (int) Arr::get($this->request->query(), 'ds_id', Cookie::get('ds_id'));
$tree = Datasource_Data_Manager::get_tree();
$cur_ds_id = Datasource_Data_Manager::exists($cur_ds_id) ? $cur_ds_id : Datasource_Data_Manager::$first_section;
$ds = $this->section($cur_ds_id);
$this->template->content = View::factory('datasource/content', array('content' => View::factory('datasource/data/index'), 'menu' => View::factory('datasource/data/menu', array('tree' => $tree, 'folders' => Datasource_Folder::get_all()))));
$this->template->footer = NULL;
$this->template->breadcrumbs = NULL;
if ($ds instanceof Datasource_Section) {
$this->set_title($ds->name);
$limit = (int) Arr::get($this->request->query(), 'limit', Cookie::get('limit'));
Cookie::set('ds_id', $cur_ds_id);
$keyword = $this->request->query('keyword');
if (!empty($limit)) {
Cookie::set('limit', $limit);
$this->section()->headline()->limit($limit);
}
$this->template->content->content->headline = $this->section()->headline()->render();
$this->template->content->content->toolbar = View::factory('datasource/' . $ds->type() . '/toolbar', array('keyword' => $keyword));
$this->template->set_global(array('datasource' => $ds));
$this->template_js_params['DS_ID'] = $this->_section->id();
$this->template_js_params['DS_TYPE'] = $this->_section->type();
} else {
$this->template->content->content = NULL;
}
}
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:28,代码来源:data.php
示例20: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->library('form_validation');
$this->lang->load('faq');
Assets::add_module_js('faq', 'faq.js');
}
开发者ID:fbmfbm,项目名称:drhil01,代码行数:12,代码来源:faq.php
注:本文中的Assets类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论