当前位置: 首页>>代码示例>>PHP>>正文


PHP Backend::addScript方法代码示例

本文整理汇总了PHP中Backend::addScript方法的典型用法代码示例。如果您正苦于以下问题:PHP Backend::addScript方法的具体用法?PHP Backend::addScript怎么用?PHP Backend::addScript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Backend的用法示例。


在下文中一共展示了Backend::addScript方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enable

 public static function enable()
 {
     Backend::addScript(SITE_LINK . '/js/jquery.js');
     Backend::addScript(SITE_LINK . '/js/wmd.component.js');
     Backend::addScript(SITE_LINK . '/js/wmd/wmd.js');
     Backend::addStyle(SITE_LINK . '/css/wmd.css');
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:7,代码来源:WMD.obj.php

示例2: html_list

 public function html_list($result)
 {
     Backend::add('Sub Title', $result->getMeta('name'));
     Backend::add('TabLinks', $this->getTabLinks(Controller::$action));
     Backend::addScript(SITE_LINK . '/js/jquery.js');
     Backend::addScript(SITE_LINK . '/js/image_list.js');
     Backend::addStyle(SITE_LINK . '/css/image_list.css');
     Backend::addContent(Render::renderFile('image.list.tpl.php', array('db_object' => $result)));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:9,代码来源:Image.obj.php

示例3: html_search

 public function html_search($result)
 {
     if (!$result instanceof DBObject) {
         Controller::whoops('Invalid Object Returned');
         return $result;
     }
     Backend::add('TabLinks', $this->getTabLinks('list'));
     if (!Backend::get('Sub Title')) {
         Backend::add('Sub Title', 'Searching ' . $result->getMeta('name'));
     }
     Backend::add('term', Controller::$parameters[0]);
     Backend::addScript(SITE_LINK . 'js/jquery.js');
     Backend::addScript(SITE_LINK . 'js/table_list.js');
     $template_file = array($result->getArea() . '.search_results.tpl.php', $result->getArea() . '/search_results.tpl.php');
     if (!Render::checkTemplateFile($template_file[0]) && !Render::checkTemplateFile($template_file[1])) {
         $template_file = 'std_search_results.tpl.php';
     }
     Backend::addContent(Render::file($template_file, array('db_object' => $result)));
     return $result;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:20,代码来源:TableCtl.obj.php

示例4: html_manage

 function html_manage($result)
 {
     Backend::add('Sub Title', 'Manage Components');
     Backend::add('result', $result);
     Links::add('Admin', '?q=admin/index', 'secondary');
     Backend::addScript(SITE_LINK . 'js/jquery.js');
     Backend::addScript(SITE_LINK . 'js/component.manage.js');
     Backend::addContent(Render::file('component.manage.tpl.php'));
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:9,代码来源:Component.obj.php

示例5: hook_post_display

 /**
  * This function adds all styles and scripts to the HTML. It also retrieves primary and secondary links from the App
  *
  */
 public static function hook_post_display($data, $controller)
 {
     Backend::addScript(SITE_LINK . '/js/backend.js');
     //TODO Add site_link, and other vars, as JS vars
     Backend::addScriptContent('var site_link = \'' . SITE_LINK . '\';');
     //TODO if someone can land a script file in the correct place, he can insert JS at will...
     $comp_script = '/js/' . Controller::$area . '.component.js';
     $comp_style = '/css/' . Controller::$area . '.component.css';
     if (file_exists(WEB_FOLDER . $comp_script)) {
         Backend::addScript(SITE_LINK . $comp_script);
     }
     if (file_exists(WEB_FOLDER . $comp_style)) {
         Backend::addStyle(SITE_LINK . $comp_style);
     }
     //Make sure that jquery and backend is right at the top
     $scripts = array_unique(array_filter(Backend::getScripts()));
     $against = array();
     if (in_array(SITE_LINK . '/js/jquery.js', $scripts)) {
         $against[] = SITE_LINK . '/js/jquery.js';
     }
     if (in_array(SITE_LINK . '/js/backend.js', $scripts)) {
         $against[] = SITE_LINK . '/js/backend.js';
     }
     $scripts = array_unique(array_merge($against, $scripts));
     Backend::add('Styles', array_unique(array_filter(Backend::getStyles())));
     Backend::add('Scripts', $scripts);
     Backend::add('ScriptContent', array_unique(array_filter(Backend::getScriptContent())));
     $primary = Links::get('primary');
     $secondary = Links::get('secondary');
     $tertiary = Links::get('tertiary');
     $app_class = ConfigValue::get('settings.Class', 'Application');
     if (class_exists($app_class, true) && method_exists($app_class, 'getLinks')) {
         $app_pri = call_user_func(array($app_class, 'getLinks'), 'primary');
         $app_sec = call_user_func(array($app_class, 'getLinks'), 'secondary');
         $app_tri = call_user_func(array($app_class, 'getLinks'), 'tertiary');
     } else {
         $app_pri = false;
         $app_sec = false;
         $app_tri = false;
     }
     $primary = array_merge($primary, is_array($app_pri) ? $app_pri : array());
     $secondary = array_merge($secondary, is_array($app_sec) ? $app_sec : array());
     $tertiary = array_merge($tertiary, is_array($app_tri) ? $app_tri : array());
     Backend::add('primary_links', $primary);
     Backend::add('secondary_links', $secondary);
     Backend::add('tertiary_links', $tertiary);
     return $data;
 }
开发者ID:jrgns,项目名称:backend-php,代码行数:52,代码来源:HtmlView.obj.php


注:本文中的Backend::addScript方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。