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


PHP data_entry_helper::late_javascript方法代码示例

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


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

示例1: get_form

 /**
  * Return the generated form output.
  * @return Form HTML.
  */
 public static function get_form($args, $node)
 {
     data_entry_helper::$website_id = $args['website_id'];
     if (!empty($args['high_volume']) && $args['high_volume']) {
         // node level caching for most page hits
         $cached = data_entry_helper::cache_get(array('node' => $node->nid), HIGH_VOLUME_CACHE_TIMEOUT);
         if ($cached !== false) {
             $cached = explode('|!|', $cached);
             data_entry_helper::$javascript = $cached[1];
             data_entry_helper::$late_javascript = $cached[2];
             data_entry_helper::$onload_javascript = $cached[3];
             data_entry_helper::$required_resources = json_decode($cached[4], true);
             return $cached[0];
         }
     }
     self::$node = $node;
     self::$called_class = 'iform_' . $node->iform;
     // Convert parameter, defaults, into structured array
     self::parse_defaults($args);
     // Supply parameters that may be missing after form upgrade
     if (method_exists(self::$called_class, 'getArgDefaults')) {
         $args = call_user_func(array(self::$called_class, 'getArgDefaults'), $args);
     }
     // Get authorisation tokens to update and read from the Warehouse. We allow child classes to generate this first if subclassed.
     if (self::$auth) {
         $auth = self::$auth;
     } else {
         $auth = data_entry_helper::get_read_write_auth($args['website_id'], $args['password']);
         self::$auth = $auth;
     }
     // Determine how the form was requested and therefore what to output
     $mode = method_exists(self::$called_class, 'getMode') ? call_user_func(array(self::$called_class, 'getMode'), $args, $node) : '';
     self::$mode = $mode;
     if ($mode === self::MODE_GRID) {
         // Output a grid of existing records
         $r = call_user_func(array(self::$called_class, 'getGrid'), $args, $node, $auth);
     } else {
         if (($mode === self::MODE_EXISTING || $mode === self::MODE_EXISTING_RO || $mode === self::MODE_CLONE) && is_null(data_entry_helper::$entity_to_load)) {
             // only load if not in error situation.
             call_user_func_array(array(self::$called_class, 'getEntity'), array(&$args, $auth));
         }
         // attributes must be fetched after the entity to load is filled in - this is because the id gets filled in then!
         $attributes = method_exists(self::$called_class, 'getAttributes') ? call_user_func(array(self::$called_class, 'getAttributes'), $args, $auth) : array();
         $r = call_user_func(array(self::$called_class, 'get_form_html'), $args, $auth, $attributes);
     }
     if (!empty($args['high_volume']) && $args['high_volume']) {
         $c = $r . '|!|' . data_entry_helper::$javascript . '|!|' . data_entry_helper::$late_javascript . '|!|' . data_entry_helper::$onload_javascript . '|!|' . json_encode(data_entry_helper::$required_resources);
         data_entry_helper::cache_set(array('node' => $node->nid), $c, HIGH_VOLUME_CACHE_TIMEOUT);
     }
     return $r;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:55,代码来源:dynamic.php

示例2: dump_javascript

 /**
  * Helper function to collect javascript code in a single location. Should be called at the end of each HTML
  * page which uses the data entry helper so output all JavaScript required by previous calls.
  *
  * @return string JavaScript to insert into the page for all the controls added to the page so far.
  *
  * @link http://code.google.com/p/indicia/wiki/TutorialBuildingBasicPage#Build_a_data_entry_page
  */
 public static function dump_javascript()
 {
     // Add the default stylesheet to the end of the list, so it has highest CSS priority
     if (self::$default_styles) {
         self::add_resource('defaultStylesheet');
     }
     self::setup_jquery_validation_js();
     $dump = self::internal_dump_javascript(self::$javascript, self::$late_javascript, self::$onload_javascript, self::$required_resources);
     // ensure scripted JS does not output again if recalled.
     self::$javascript = "";
     self::$late_javascript = "";
     self::$onload_javascript = "";
     return $dump;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:22,代码来源:data_entry_helper.php

示例3: dump_javascript

 /**
  * Helper function to collect javascript code in a single location. Should be called at the end of each HTML
  * page which uses the data entry helper so output all JavaScript required by previous calls.
  *
  * @return string JavaScript to insert into the page for all the controls added to the page so far.
  *
  * @link http://code.google.com/p/indicia/wiki/TutorialBuildingBasicPage#Build_a_data_entry_page
  */
 public static function dump_javascript()
 {
     global $indicia_resources, $indicia_templates;
     // Add the default stylesheet to the end of the list, so it has highest CSS priority
     if (self::$default_styles) {
         self::add_resource('defaultStylesheet');
     }
     // If required, setup jQuery validation. We can't prep this JavaScript earlier since we would
     // not know all the control messages.
     // In the following block, we set the validation plugin's error class to our template.
     // We also define the error label to be wrapped in a <p> if it is on a newline.
     if (self::$validated_form_id) {
         self::$javascript .= "\$('#" . self::$validated_form_id . "').validate({\n        errorClass: \"" . $indicia_templates['error_class'] . "\",\n        " . (in_array('inline', self::$validation_mode) ? "\n      " : "errorElement: 'p',\n      ") . "highlight: function(element, errorClass) {\n           // Don't highlight the actual control, as it could be hidden anyway\n        },\n        messages: " . json_encode(self::$validation_messages) . "\n      });\n";
     }
     $dump = self::internal_dump_javascript(self::$javascript, self::$late_javascript, self::$onload_javascript, $indicia_resources);
     // ensure scripted JS does not output again if recalled.
     self::$javascript = "";
     self::$late_javascript = "";
     self::$onload_javascript = "";
     return $dump;
 }
开发者ID:BirenRathod,项目名称:drupal-6,代码行数:29,代码来源:data_entry_helper.php


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