本文整理汇总了PHP中Assets::add_js方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::add_js方法的具体用法?PHP Assets::add_js怎么用?PHP Assets::add_js使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::add_js方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Product_Documents.Content.View');
$this->load->model('product_documents_model', null, true);
$this->load->model(array('vendor_profile/vendor_profile_model', 'product/product_model', 'document_types/document_types_model'));
$this->lang->load('product_documents');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('product_documents', 'product_documents.js');
$profile_id = NULL;
if (isset($this->curr_user_profile['id'])) {
$profile_id = $this->curr_user_profile['id'];
}
$vendors_select = $this->vendor_profile_model->get_vendors_select($profile_id);
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendor_profile_model->get_vendors($profile_id);
Template::set('vendors', $vendors);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
$doc_types_select = $this->document_types_model->get_doc_types_select();
Template::set('doc_types_select', $doc_types_select);
$doc_types = $this->document_types_model->get_doc_types();
Template::set('doc_types', $doc_types);
}
示例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;' />";
}
示例4: 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();
}
示例5: 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();
}
示例6: __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);
}
示例7: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Quotes.Content.View');
$this->load->model('quotes_model', null, true);
$this->load->model(array('uom/uom_model', 'product/product_model', 'vendor_profile/vendor_profile_model'));
$this->lang->load('quotes');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('quotes', 'quotes.js');
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
/*
$vendors_select = $this->vendors_model->get_vendors_select();
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendors_model->get_vendors();
Template::set('vendors', $vendors);
*/
$vendors_select = $this->vendor_profile_model->get_vendors_select();
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendor_profile_model->get_vendors();
Template::set('vendors', $vendors);
}
示例8: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Containers.Content.View');
$this->load->model('containers_model', null, true);
$this->load->model(array('purchase_orders/purchase_orders_model', 'countries_model', 'product/product_model', 'uom/uom_model'));
$this->lang->load('containers');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('containers', 'containers.js');
$po_refs_select = $this->purchase_orders_model->get_po_ref_select();
Template::set('po_refs_select', $po_refs_select);
$po_refs = $this->purchase_orders_model->get_po_refs();
Template::set('po_refs', $po_refs);
$countries_select = $this->countries_model->get_countries_select();
Template::set('countries_select', $countries_select);
$countries = $this->countries_model->get_countries();
Template::set('countries', $countries);
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
}
示例9: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Samples.Content.View');
$this->load->model('samples_model', null, true);
$this->load->model(array('uom/uom_model', 'product/product_model', 'customers/customers_model', 'vendor_profile/vendor_profile_model'));
$this->lang->load('samples');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('samples', 'samples.js');
$profile_id = NULL;
if (isset($this->curr_user_profile['id'])) {
$profile_id = $this->curr_user_profile['id'];
}
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
$party_select = $this->customers_model->get_party_select();
Template::set('party_select', $party_select);
$party = $this->customers_model->get_party();
Template::set('party', $party);
Template::set('vendors', $vendors);
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->lang->load('dashboard', 'english');
$data['lang']['nav_user'] = $this->lang->line('nav_user');
Assets::add_js('product/create_product.js');
Assets::add_css('product/product.css');
}
示例11: index
public function index()
{
$this->load->helper('file');
Assets::add_js($this->load->view('developer/logs_js', null, true), 'inline');
// Log Files
Template::set('logs', get_filenames($this->config->item('log_path')));
Template::render();
}
示例12: __construct
public function __construct()
{
parent::__construct();
$this->is_login();
$this->load->model('category_model', 'cm');
Assets::add_js('lib/treeview.js');
Assets::add_js('category/category.js');
assets::add_css('category/category.css');
}
示例13: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->load->model('orders/orders_model');
$this->load->model('comments/comments_model');
$this->lang->load('orders');
Assets::add_js('codeigniter-csrf.js');
Assets::add_js(Template::theme_url('js/editors/ckeditor/ckeditor.js'));
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->auth->restrict('Site.Settings.View');
$this->load->helper('config_file');
$this->lang->load('database');
Template::set('toolbar_title', 'Database Settings');
Assets::add_js($this->load->view('settings/database_js', null, true), 'inline');
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->auth->restrict('Site.Settings.View');
$this->auth->restrict('Bonfire.Users.View');
$this->load->model('roles/role_model');
Assets::add_js($this->load->view('settings/users_js', null, true), 'inline');
$this->lang->load('users');
}