Пример #1
0
 function pre_parse()
 {
     $action = array();
     if (!isset($this->attributes['action']) && !isset($this->attributes['shortcut'])) {
         error('ATTRIBUTE_REQUIRED', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('tag' => $this->tag, 'attribute' => 'path or shortcut', 'file' => $this->source_file, 'line' => $this->starting_line_no));
     }
     if (isset($this->attributes['shortcut'])) {
         $action['action'] = get_ini_option('grid_actions.ini', $this->attributes['shortcut'], 'action');
         $action['path'] = get_ini_option('grid_actions.ini', $this->attributes['shortcut'], 'path');
     } else {
         $action['action'] = $this->attributes['action'];
         if (isset($this->attributes['path'])) {
             $action['path'] = $this->attributes['locale_value'];
         }
     }
     if (isset($this->attributes['locale_value'])) {
         $action['locale_value'] = $this->attributes['locale_value'];
     }
     if (isset($this->attributes['locale_file'])) {
         $action['locale_file'] = $this->attributes['locale_file'];
     }
     if (isset($this->attributes['name'])) {
         $action['name'] = $this->attributes['name'];
     }
     $this->parent->register_action($action);
     return PARSER_REQUIRE_PARSING;
 }
Пример #2
0
  function pre_parse()
  {
    $action = array();

    if(!isset($this->attributes['action']) && !isset($this->attributes['shortcut']))
    {
      error('ATTRIBUTE_REQUIRED', __FILE__ . ' : ' . __LINE__ . ' : ' .  __FUNCTION__,
      array('tag' => $this->tag,
          'attribute' => 'path or shortcut',
          'file' => $this->source_file,
          'line' => $this->starting_line_no));
    }

    if(isset($this->attributes['shortcut']))
    {
      $action['action'] = get_ini_option('admin_list_actions.ini', $this->attributes['shortcut'], 'action');
      $action['path'] = get_ini_option('admin_list_actions.ini', $this->attributes['shortcut'],  'path');
      unset($this->attributes['shortcut']);
    }
    else
      $action['action'] = $this->attributes['action'];

    foreach($this->attributes as $attr_name => $attr_value)
      $action[$attr_name] = $attr_value;

    $this->parent->register_action($action);

    return PARSER_REQUIRE_PARSING;
  }
Пример #3
0
 /**
  * Constructs template
  * 
  * @param string $ name of (source) template file (relative or full path)
  * @access public 
  */
 function template($file, $resolve_path = true)
 {
     $this->file = $file;
     if ($resolve_path) {
         if (!($srcfile = resolve_template_source_file_name($file))) {
             error('template file not found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('file' => $file));
         }
     } else {
         $srcfile = $file;
     }
     $this->codefile = resolve_template_compiled_file_name($srcfile, TMPL_INCLUDE);
     if (!isset($GLOBALS['template_render'][$this->codefile])) {
         if (get_ini_option('config.ini', 'templates', 'force_compile')) {
             compile_template_file($file, $resolve_path);
         }
         if (!file_exists($this->codefile)) {
             compile_template_file($file, $resolve_path);
         }
         $errorlevel = error_reporting();
         error_reporting($errorlevel & ~E_WARNING);
         $parse_error = (include_once $this->codefile);
         error_reporting($errorlevel);
     }
     $this->render_function = $GLOBALS['template_render'][$this->codefile];
     $func = $GLOBALS['template_construct'][$this->codefile];
     $func($this);
 }
function load_system_tags()
{
    $path = get_ini_option('compiler.ini', 'tags', 'path');
    foreach ($path as $tagpath) {
        load_tags(LIMB_DIR . 'core/template/tags/' . $tagpath);
    }
}
 function perform()
 {
     $result = $this->set_publish_status(get_ini_option('doc_flow.ini', 'default', 'unpublished'));
     if ($result !== false) {
         close_popup();
     } else {
         return false;
     }
 }
 function _get_groups()
 {
     if ($this->groups) {
         return $this->groups;
     }
     if (ini_exists('referers_groups.ini')) {
         $this->groups = get_ini_option('referers_groups.ini', 'groups');
     }
     return $this->groups;
 }
function load_project_tags()
{
    $path = get_ini_option('config.ini', 'path', 'project_tags');
    if (!$path) {
        return;
    }
    foreach ($path as $tagpath) {
        load_tags(PROJECT_DIR . 'core/template/tags/' . $tagpath);
    }
}
Пример #8
0
 /**
  * Constructs template
  * 
  * @param string $ name of (source) template file (relative or full path)
  * @access public 
  */
 function template($file)
 {
     $this->file = $file;
     $srcfile = resolve_template_source_file_name($file, TMPL_INCLUDE);
     $this->codefile = resolve_template_compiled_file_name($srcfile, TMPL_INCLUDE);
     if (!isset($GLOBALS['template_render'][$this->codefile])) {
         if (get_ini_option('config.ini', 'templates', 'force_compile')) {
             compile_template_file($file);
         }
         if (!file_exists($this->codefile)) {
             compile_template_file($file);
         }
         $errorlevel = error_reporting();
         error_reporting($errorlevel & ~E_WARNING);
         $parse_error = (include_once $this->codefile);
         error_reporting($errorlevel);
     }
     $this->render_function = $GLOBALS['template_render'][$this->codefile];
     $func = $GLOBALS['template_construct'][$this->codefile];
     $func($this);
 }
 function _set_options_from_ini_file()
 {
     $ini_file = $this->get_attribute('options_ini_file');
     $this->set_choices(get_ini_option($ini_file . '.ini', 'constants', 'options'));
     if (!$this->get_default_value()) {
         $this->set_default_value(get_ini_option($ini_file . '.ini', 'constants', 'default_option'));
     }
 }
                if (substr($tag_file, -8, 8) == '.tag.php') {
                    include_once $tag_dir . '/' . $tag_file;
                }
            }
            closedir($dir);
        }
    }
}
/**
* Create the tag_dictionary global variable
*/
$GLOBALS['tag_dictionary'] =& new tag_dictionary();
/**
* Load some tag files
*/
$path = get_ini_option('compiler.ini', 'tags', 'path');
foreach ($path as $tagpath) {
    if (substr($tagpath, 0, 1) != '/') {
        load_tags(LIMB_DIR . 'core/template/tags/' . $tagpath);
        load_tags(PROJECT_DIR . 'core/template/tags/' . $tagpath);
    } else {
        load_tags($tagpath);
    }
}
/**
* Compiles a template file. Uses the file scheme to location the source,
* instantiates the code_writer and root_compiler_component (as the root) component then
* instantiates the source_file_parser to parse the template.
* Creates the initialize and render functions in the compiled template.
* 
* @see root_compiler_component
	function perform()
	{
		$this->set_publish_status(get_ini_option('doc_flow.ini', 'default', 'published'));
		
		return new close_popup_response();
	}
 function perform()
 {
     $this->set_publish_status(get_ini_option('doc_flow.ini', 'default', 'unpublished'));
     close_popup();
 }
/**
* Compiles all templates in the scheme
* 
* @return void 
* @access protected 
*/
function compile_entire_file_scheme()
{
    // Need to add support for accumulating error messages.
    $root = get_ini_option('config.ini', 'filescheme', 'templateroot');
    if (isset($root)) {
        $source_root = $root . '/source';
    } else {
        $source_root = dirname($_SERVER['SCRIPT_FILENAME']) . '/templates/source';
    }
    recursive_compile_all($source_root, '/');
}