Exemplo n.º 1
0
 function generate_contents(&$code)
 {
     $parent =& $this->find_parent_by_class('pager_navigator_tag');
     $code->write_php('if (' . $parent->get_component_ref_code() . '->has_prev()) {');
     parent::generate_contents($code);
     $code->write_php('}');
 }
 function generate_contents(&$code)
 {
     if (isset($this->attributes['hash_id']) && isset($this->attributes['target'])) {
         $code->write_php($this->get_component_ref_code() . '->make_transfer(\'' . $this->attributes['hash_id'] . '\', \'' . $this->attributes['target'] . '\');');
     }
     parent::generate_contents($code);
 }
Exemplo n.º 3
0
 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function generate_contents(&$code)
 {
     $parent_form =& $this->find_parent_by_class('form_tag');
     $target =& $this->parent->find_child($this->attributes['target']);
     $code->write_php($target->get_component_ref_code() . '->register_dataset(' . $parent_form->get_component_ref_code() . '->get_error_dataset());');
     parent::generate_contents($code);
 }
Exemplo n.º 4
0
 function generate_contents(&$code)
 {
     if (isset($this->attributes['name']) && isset($this->attributes['type'])) {
         $code->write_php($this->get_component_ref_code() . '->get_param("' . $this->attributes['name'] . '","' . $this->attributes['type'] . '");');
     }
     parent::generate_contents($code);
 }
Exemplo n.º 5
0
 function generate_contents(&$code)
 {
     parent::generate_contents($code);
     if (isset($this->attributes['navigator'])) {
         if ($navigator =& $this->parent->find_child($this->attributes['navigator'])) {
             $limit = $code->get_temp_variable();
             $code->write_php('$' . $limit . '= ' . $navigator->get_component_ref_code() . '->get_items_per_page();');
             $code->write_php($this->get_component_ref_code() . '->set_parameter("limit", $' . $limit . ');');
             $code->write_php('if(isset($_GET["page_' . $navigator->get_server_id() . '"])){');
             $code->write_php($this->get_component_ref_code() . '->set_parameter("offset", ($_GET["page_' . $navigator->get_server_id() . '"]-1)*$' . $limit . ');');
             $code->write_php('}');
         }
     }
     $targets = explode(',', $this->attributes['target']);
     foreach ($targets as $target) {
         if ($target_component =& $this->parent->find_child(trim($target))) {
             $code->write_php($target_component->get_component_ref_code() . '->register_dataset(' . $this->get_component_ref_code() . '->get_dataset());');
         } else {
             debug::write_error('component target not found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('target' => $target));
         }
     }
     if (isset($this->attributes['navigator']) && $navigator) {
         $code->write_php($navigator->get_component_ref_code() . '->set_total_items(' . $this->get_component_ref_code() . '->get_total_count());');
     }
 }
Exemplo n.º 6
0
 function pre_generate(&$code)
 {
     $parent =& $this->find_parent_by_class('pager_navigator_tag');
     parent::pre_generate($code);
     $code->write_php($this->get_component_ref_code() . '->set("number", ' . $parent->get_component_ref_code() . '->get_total_items());');
     $code->write_php($this->get_component_ref_code() . '->set("more_than_one_page", ' . $parent->get_component_ref_code() . '->has_more_than_one_page());');
 }
Exemplo n.º 7
0
	/**
	* 
	* @param code $ _writer
	* @return void 
	* @access protected 
	*/
	function post_generate(&$code)
	{
		$code->write_php($this->get_component_ref_code() . '->cache(ob_get_contents());ob_end_clean();');
		$code->write_php('}');
		$code->write_php($this->get_component_ref_code() . '->render();');
		parent::post_generate($code);
	} 
Exemplo n.º 8
0
  function generate_contents(&$code)
  {
    $ref = $this->get_component_ref_code();
    $code->write_php("{$ref}->load_metadata();\n");

    parent :: generate_contents($code);

  }
Exemplo n.º 9
0
 function generate_contents(&$code)
 {
     $list_child =& $this->find_immediate_child_by_class('fetch_list_tag');
     if ($list_child) {
         $code->write_php($list_child->get_component_ref_code() . '->set_path($_SERVER["PHP_SELF"]);');
     }
     $code->write_php($this->get_component_ref_code() . '->fetch_mapped_by_url();');
     server_component_tag::generate_contents($code);
 }
Exemplo n.º 10
0
 /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
 function generate_contents(&$code)
 {
     $parent =& $this->find_parent_by_class('pager_navigator_tag');
     $code->write_php('if (!' . $parent->get_component_ref_code() . '->is_current_page()) {');
     $code->write_php($this->get_component_ref_code() . '->set("href", ' . $parent->get_component_ref_code() . '->get_current_page_uri());');
     $code->write_php($this->get_component_ref_code() . '->set("number", ' . $parent->get_component_ref_code() . '->get_page_number());');
     parent::generate_contents($code);
     $code->write_php('}');
 }
Exemplo n.º 11
0
 function post_generate(&$code)
 {
     $code->write_php('} else {');
     if ($default =& $this->find_immediate_child_by_class('grid_default_tag')) {
         $default->generate_now($code);
     }
     $code->write_php('}');
     parent::post_generate($code);
 }
Exemplo n.º 12
0
 /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
 function post_generate(&$code)
 {
     if (!$this->hide_for_current_page) {
         $parent =& $this->find_parent_by_class('pager_navigator_tag');
         $code->write_php('if (!' . $parent->get_component_ref_code() . '->is_last()) {');
     }
     parent::post_generate($code);
     $code->write_php('}');
 }
Exemplo n.º 13
0
 function generate_contents(&$code)
 {
     $ref = $this->get_component_ref_code();
     if (isset($this->attributes['separator'])) {
         $code->write_php("{$ref}->set_title_separator(\"" . $this->attributes['separator'] . "\");\n");
     }
     $ref = $this->get_component_ref_code();
     $code->write_php("echo {$ref}->get_title();\n");
     parent::generate_contents($code);
 }
Exemplo n.º 14
0
 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function post_generate(&$code)
 {
     $code->write_php('}');
     $emptychild =& $this->find_immediate_child_by_class('list_default_tag');
     if ($emptychild) {
         $code->write_php(' else {');
         $emptychild->generate_now($code);
         $code->write_php('}');
     }
     parent::post_generate($code);
 }
Exemplo n.º 15
0
 function generate_contents(&$code)
 {
     $v = '$' . $code->get_temp_variable();
     $code->write_php($this->get_component_ref_code() . '->prepare();');
     $code->write_php('if (!(' . $v . ' = ' . $this->get_component_ref_code() . '->get())) {');
     $code->write_php('ob_start();');
     parent::generate_contents($code);
     $code->write_php($this->get_component_ref_code() . '->write(ob_get_contents());ob_end_flush();');
     $code->write_php('}');
     $code->write_php('else echo ' . $v . ';');
 }
Exemplo n.º 16
0
 function generate_contents(&$code)
 {
     $child_list =& $this->find_immediate_child_by_class('list_list_tag');
     if (isset($this->attributes['offset_path'])) {
         $code->write_php($this->get_component_ref_code() . '->set_offset_path("' . $this->attributes['offset_path'] . '");');
     }
     if ($child_list) {
         $code->write_php($child_list->get_component_ref_code() . '->register_dataset(' . $this->get_component_ref_code() . '->get_breadcrumbs_dataset());');
     }
     parent::generate_contents($code);
 }
 function generate_contents(&$code)
 {
     if (isset($this->attributes['target'])) {
         $target = 'target=' . $this->attributes['target'];
     } else {
         $target = '';
     }
     $code->write_php('echo "<a ' . $target . ' href=" . ' . $this->get_component_ref_code() . '->get_current_template_source_link() . ">"');
     parent::generate_contents($code);
     $code->write_php('echo "</a>"');
 }
Exemplo n.º 18
0
 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function generate_constructor(&$code)
 {
     parent::generate_constructor($code);
     if (array_key_exists('items', $this->attributes)) {
         $code->write_php($this->get_component_ref_code() . '->items = \'' . $this->attributes['items'] . '\';');
         unset($this->attributes['items']);
     }
     if (array_key_exists('pages_per_section', $this->attributes)) {
         $code->write_php($this->get_component_ref_code() . '->pages_per_section = \'' . $this->attributes['pages_per_section'] . '\';');
         unset($this->attributes['pages_per_section']);
     }
 }
Exemplo n.º 19
0
 function get_component_ref_code()
 {
     if (isset($this->attributes['mirror_of'])) {
         if ($mirrored_pager =& $this->parent->find_child($this->attributes['mirror_of'])) {
             return $mirrored_pager->get_component_ref_code();
         } else {
             debug::write_error('mirror_of pager component not found', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('mirror_of' => $this->attributes['mirror_of']));
         }
     } else {
         return parent::get_component_ref_code();
     }
 }
Exemplo n.º 20
0
 function generate_contents(&$code)
 {
     parent::generate_contents($code);
     if (isset($this->attributes['navigator'])) {
         $code->write_php($this->get_component_ref_code() . '->set("navigator_id", "' . $this->attributes['navigator'] . '");');
         $code->write_php($this->get_component_ref_code() . '->setup_navigator();');
     }
     $code->write_php($this->get_component_ref_code() . '->set("target", "' . $this->attributes['target'] . '");');
     $code->write_php($this->get_component_ref_code() . '->setup_target();');
     if (isset($this->attributes['navigator'])) {
         $code->write_php($this->get_component_ref_code() . '->fill_navigator();');
     }
 }
  function generate_contents(&$code)
  {
    $ref = $this->get_component_ref_code();

    if(isset($this->attributes['resolve_by'])
        && $this->attributes['resolve_by'] == 'path')
      $this->_set_path_resolver($code);
    else
      $this->_set_identifier_resolver($code);

    $code->write_php("{$ref}->get_string();\n");

    parent :: generate_contents($code);
  }
Exemplo n.º 22
0
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $actions_array = '$' . $code->get_temp_variable();
     $node_id = '$' . $code->get_temp_variable();
     $node = '$' . $code->get_temp_variable();
     $code->write_php("{$actions_array} = " . $this->parent->get_dataspace_ref_code() . '->get("actions");' . "\n");
     $code->write_php("{$node_id} = " . $this->parent->get_dataspace_ref_code() . '->get("node_id");' . "\n");
     $code->write_php("if(!{$node_id}){ \r\n\t\t\t{$node} =& map_url_to_node(); {$node_id} = {$node}['id'];}\n");
     $code->write_php($this->get_component_ref_code() . "->set_actions({$actions_array});\n");
     $code->write_php($this->get_component_ref_code() . "->set_node_id({$node_id});\n");
     $code->write_php($this->get_component_ref_code() . '->prepare();' . "\n");
     $code->write_php('if (' . $this->get_component_ref_code() . '->next()) {');
 }
Exemplo n.º 23
0
	function post_generate(&$code)
	{
		$code->write_php('} else {');
		
		if ($default = &$this->find_immediate_child_by_class('grid_default_tag'))
			$default->generate_now($code);
			
		$code->write_php('}');

		if ($this->has_form)
		{
			$code->write_html('</form>');
		}	
		
		parent :: post_generate($code);
	} 
Exemplo n.º 24
0
  function generate_contents(&$code)
  {
    $ref = $this->get_component_ref_code();

    if(isset($this->attributes['identifier']))
      $code->write_php("{$ref}->set(\"identifier\", \"". $this->attributes['identifier'] ."\");\n");
    else
      $code->write_php("{$ref}->set(\"identifier\", " . $this->parent->get_dataspace_ref_code() ."->get('icon'));\n");

    if(isset($this->attributes['variation']))
      $code->write_php("{$ref}->set(\"variation\", \"". $this->attributes['variation'] ."\");\n");

    $code->write_php("{$ref}->get_icon_path();\n");

    parent :: generate_contents($code);
  }
Exemplo n.º 25
0
 function generate_contents(&$code)
 {
     if (isset($this->attributes['hash_id'])) {
         if (isset($this->attributes['locale_type'])) {
             $code->write_php($this->get_component_ref_code() . '->set_locale_type("' . $this->attributes['locale_type'] . '");');
         }
         if (isset($this->attributes['type'])) {
             $code->write_php($this->get_component_ref_code() . '->set_date_type("' . $this->attributes['type'] . '");');
         }
         $code->write_php($this->get_component_ref_code() . '->set_date(' . $this->get_dataspace_ref_code() . '->get("' . $this->attributes['hash_id'] . '"));');
         if (isset($this->attributes['locale_format'])) {
             $code->write_php($this->get_component_ref_code() . '->set_locale_format_type("' . $this->attributes['locale_format'] . '");');
         } elseif (isset($this->attributes['format'])) {
             $code->write_php($this->get_component_ref_code() . '->set_format_string("' . $this->attributes['format'] . '");');
         }
         $code->write_php($this->get_component_ref_code() . '->format();');
     }
     parent::generate_contents($code);
 }
Exemplo n.º 26
0
 function generate_contents(&$code)
 {
     if (isset($this->attributes['navigator'])) {
         if ($navigator =& $this->parent->find_child($this->attributes['navigator'])) {
             $limit = $code->get_temp_variable();
             $code->write_php('$' . $limit . '= ' . $navigator->get_component_ref_code() . '->get_items_per_page();');
             $code->write_php($this->get_component_ref_code() . '->set_parameter("limit", $' . $limit . ');');
             $code->write_php('if(isset($_GET["page_' . $navigator->get_server_id() . '"])){');
             $code->write_php($this->get_component_ref_code() . '->set_parameter("offset", ($_GET["page_' . $navigator->get_server_id() . '"]-1)*$' . $limit . ');');
             $code->write_php('}');
         }
     }
     $target =& $this->parent->find_child($this->attributes['target']);
     parent::generate_contents($code);
     if ($target) {
         $code->write_php($target->get_component_ref_code() . '->register_dataset(' . $this->get_component_ref_code() . '->get_dataset());');
     }
     if (isset($this->attributes['navigator']) && $navigator) {
         $code->write_php($navigator->get_component_ref_code() . '->set_total_items(' . $this->get_component_ref_code() . '->get_total_count());');
     }
 }
Exemplo n.º 27
0
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $code->write_php($this->get_component_ref_code() . '->prepare();');
 }
 /**
 * Writes the compiled template constructor from the runtime component,
 * assigning the attributes found at compile time to the runtime component
 * via a serialized string
 *
 * @param code $ _writer
 * @return void
 * @access protected
 */
 function generate_constructor(&$code)
 {
   parent::generate_constructor($code);
   $code->write_php($this->get_component_ref_code() . '->attributes = ' . var_export($this->attributes, true) . ';');
 }
Exemplo n.º 29
0
 function pre_generate(&$code)
 {
     parent::pre_generate($code);
     $code->write_php($this->get_component_ref_code() . "->import(" . $this->parent->get_dataspace_ref_code() . "->export());\n");
     $code->write_php($this->get_component_ref_code() . '->prepare();' . "\n");
 }
Exemplo n.º 30
0
	function generate_contents(&$code)
	{		
		$code->write_php('if (' . $this->get_component_ref_code() . '->poll_exists()) {');
		parent :: generate_contents($code);
		$code->write_php('}');
	}