Example #1
0
 function generate_contents(&$code)
 {
     $file = 'common';
     if (isset($this->attributes['file'])) {
         $file = $this->attributes['file'];
     }
     if (isset($this->attributes['locale_type'])) {
         if (strtolower($this->attributes['locale_type']) == 'content') {
             $locale_constant = 'CONTENT_LOCALE_ID';
         } else {
             $locale_constant = 'MANAGEMENT_LOCALE_ID';
         }
     } else {
         $locale_constant = 'MANAGEMENT_LOCALE_ID';
     }
     if (isset($this->attributes['hash_id'])) {
         $locale_tmp = '$' . $code->get_temp_variable();
         $code->write_php("{$locale_tmp} = " . $this->get_dataspace_ref_code() . '->get("' . $this->attributes['hash_id'] . '");');
         if (defined('DEBUG_TEMPLATE_I18N_ENABLED') && constant('DEBUG_TEMPLATE_I18N_ENABLED')) {
             $code->write_php("\n          echo '<img src=\\'/shared/images/i.gif\\' title=\\'&#039;{$locale_tmp}&#039; from &#039;{$file}_???&#039; i18n file\\'>';");
         }
         $code->write_php("echo strings :: get({$locale_tmp}, '{$file}', constant('{$locale_constant}'));");
     } elseif (isset($this->attributes['name'])) {
         if (defined('DEBUG_TEMPLATE_I18N_ENABLED') && constant('DEBUG_TEMPLATE_I18N_ENABLED')) {
             $code->write_php("\n          echo '<img src=\\'/shared/images/i.gif\\' title=\\'&#039;{$this->attributes['name']}&#039; from &#039;{$file}_???&#039; i18n file\\'>';");
         }
         $code->write_php("echo strings :: get('{$this->attributes['name']}', '{$file}', constant('{$locale_constant}'));");
     }
     parent::generate_contents($code);
 }
  function post_generate(&$code)
  {
    if(!count($this->actions))
      parent :: post_generate($code);

    $code->write_html("<script>arr_actions['{$this->grid_list_id}'] = {");

    foreach($this->actions as $action_name => $action)
    {
      $action_path = $this->get_action_path($action);
      $code->write_html("'{$action_name}':{'href':'{$action_path}', 'name': '");

      if(isset($action['locale_value']))
      {
        $locale_file = '';
        if(isset($action['locale_file']))
          $locale_file = "','{$action['locale_file']}";
        $code->write_php("echo strings :: get('" . $action['locale_value'] . $locale_file ."')");
      }
      else
        $code->write_html($action['name']);

      $code->write_html("'},");
    }
    $code->write_html("'_' : {}}</script>");

    $code->write_html("<span id='{$this->grid_list_id}' behavior='CDDGridAction' ddalign='vbr'><img alt='' src='/shared/images/marker/1.gif'> ");
    $code->write_php("echo strings :: get('actions_for_selected');");
    $code->write_html("</span>");
    parent :: post_generate($code);
  }
 function post_generate(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
     parent::post_generate($code);
 }
 function post_generate(&$code)
 {
     if (!count($this->actions)) {
         parent::post_generate($code);
     }
     $selector_id = uniqid('');
     $code->write_html("\n    <select id='{$selector_id}'>\n        <option value=''>");
     $code->write_php("echo strings :: get('choose_any')");
     $code->write_html("</option>");
     foreach ($this->actions as $option) {
         $action_path = $this->get_action_path($option);
         $code->write_html("<option value='{$action_path}'>");
         if (isset($option['locale_value'])) {
             $locale_file = '';
             if (isset($option['locale_file'])) {
                 $locale_file = "','{$option['locale_file']}";
             }
             $code->write_php("echo strings :: get('" . $option['locale_value'] . $locale_file . "')");
         } else {
             $code->write_html($option['name']);
         }
         $code->write_html("</option>");
     }
     $code->write_html("</select>");
     $this->render_button($code, $selector_id);
     parent::post_generate($code);
 }
Example #5
0
  function generate_contents(&$code)
  {
    $dataspace = $this->get_dataspace_ref_code();

    $counter = '$' . $code->get_temp_variable();
    $value = '$' . $code->get_temp_variable();

    if (isset($this->attributes['hash_id']))
    {
      $code->write_php($value . ' = trim(' . $this->get_dataspace_ref_code() . '->get(\'' . $this->attributes['hash_id'] . '\'));');
    }
    else
    {
      if(!isset($this->attributes['value']))
        $this->attributes['value'] = 1;

      $code->write_php($value . ' = ' . $this->attributes['value'] . ';');
    }

    $code->write_php('for(' . $counter . '=0;' . $counter . ' < ' . $value . '; ' . $counter . '++){');

    parent :: generate_contents($code);

    $code->write_php('}');

  }
 function generate_contents(&$code)
 {
     $groups = $this->attributes['groups'];
     $code->write_php("if (user :: is_logged_in() && (user :: is_in_groups('{$groups}'))) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
 function generate_contents(&$code)
 {
     $user = '******' . $code->get_temp_variable();
     $code->write_php("{$user} =& user :: instance();");
     $code->write_php("if (!{$user}->is_logged_in()) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
	function generate_contents(&$code)
	{
		$code->write_php('
		require_once(LIMB_DIR . "/core/model/chat/chat_user.class.php");
		if (!chat_user :: is_logged_in()) {');
			parent :: generate_contents($code);
		$code->write_php("}");
	}
Example #9
0
  /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
  function generate_contents(&$code)
  {
    $code->write_php('do { ');

    parent::generate_contents($code);

    $code->write_php('} while (' . $this->get_dataspace_ref_code() . '->next());');
  }
 function generate_contents(&$code)
 {
     $user_methods = get_class_methods('user');
     if (in_array('get_' . $this->attributes['name'], $user_methods)) {
         $code->write_php("echo user :: get_{$this->attributes['name']}();");
     }
     parent::generate_contents($code);
 }
 function generate_contents(&$code)
 {
     $groups = $this->attributes['groups'];
     $user = '******' . $code->get_temp_variable();
     $code->write_php("{$user} =& user :: instance();");
     $code->write_php("if ({$user}->is_logged_in() && ({$user}->is_in_groups('{$groups}'))) {");
     parent::generate_contents($code);
     $code->write_php("}");
 }
 function generate_contents(&$code)
 {
     $temp = '$' . $code->get_temp_variable();
     $code->write_php('ob_start();');
     parent::generate_contents($code);
     $code->write_php($temp . ' = ob_get_contents();');
     $code->write_php('ob_end_clean();');
     $code->write_php($this->parent->get_component_ref_code() . '->set_left_mark("' . $temp . '");');
 }
Example #13
0
 function generate_contents(&$code)
 {
     $mapped = '$' . $code->get_temp_variable();
     $code->write_php("{$mapped} = fetch_mapped_by_url();");
     $code->write_php("if(isset({$mapped}['actions']) && array_key_exists('print_version', {$mapped}['actions'])){");
     $code->write_php($this->get_dataspace_ref_code() . "->set('link', {$mapped}['path'] . '?action=print_version');");
     parent::generate_contents($code);
     $code->write_php('}');
 }
  function post_generate(&$code)
  {
    $code->write_html("</a></td>
          </tr>
          </table>
        </td>
    ");

    parent :: post_generate($code);
  }
Example #15
0
 function generate_contents(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html("<div style='border:dashed 1px red;'><img src='/shared/images/i.gif' alt='{$this->resolved_source_file}'><br>");
     }
     parent::generate_contents($code);
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
 }
	function generate_contents(&$code)
	{
		$value = $this->_typecast_value();
		
		$code->write_php($this->parent->get_component_ref_code() 
			. '->set_parameter("' . $this->attributes['name'] . '", ' 
			. var_export($value, true) . ')');
		
		parent::generate_contents($code);
	}
 function generate_contents(&$code)
 {
     $user_methods = get_class_methods('user');
     $user = '******' . $code->get_temp_variable();
     if (in_array('get_' . $this->attributes['name'], $user_methods)) {
         $code->write_php("{$user} =& user :: instance();");
         $code->write_php("echo {$user}->get_{$this->attributes['name']}();");
     }
     parent::generate_contents($code);
 }
Example #18
0
 function generate_contents(&$code)
 {
     $dataspace = $this->get_dataspace_ref_code();
     if (isset($this->attributes['hash_id']) && isset($this->attributes['child_id'])) {
         if ($child =& $this->find_child($this->attributes['child_id'])) {
             $code->write_php($child->get_component_ref_code() . '->register_dataset(new array_dataset(' . $dataspace . '->get("' . $this->attributes['hash_id'] . '")))');
         }
     }
     parent::generate_contents($code);
 }
Example #19
0
 function generate_contents(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html("<div style='border:dashed 1px red;padding:10px 10px 10px 10px;'>");
         $this->_generate_debug_editor_link_html($code, $this->resolved_source_file);
     }
     parent::generate_contents($code);
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
 }
Example #20
0
 function generate_contents(&$code)
 {
     if ($this->is_debug_enabled()) {
         $code->write_html("<div class='debug-tmpl-include'>");
         $this->_generate_debug_editor_link_html($code, $this->resolved_source_file);
     }
     parent::generate_contents($code);
     if ($this->is_debug_enabled()) {
         $code->write_html('</div>');
     }
 }
 function pre_generate(&$code)
 {
     $value = '$' . $code->get_temp_variable();
     $parent = $this->get_dataspace_ref_code();
     $radio_child =& $this->find_child_by_class('input_tag');
     $label_child =& $this->find_child_by_class('label_tag');
     $radio = $radio_child->get_component_ref_code();
     $label = $label_child->get_component_ref_code();
     $code->write_php("\r\n    if ({$value} = {$parent}->get('id'))\r\n    {\r\n      {$radio}->set_attribute('value', {$value});\r\n      {$radio}->set_attribute('id', {$value});\r\n      {$label}->set_attribute('for', {$value});\r\n    }\r\n    ");
     parent::pre_generate($code);
 }
Example #22
0
 /**
  *
  * @param code $ _writer
  * @return void
  * @access protected
  */
 function post_generate(&$code)
 {
     $code->write_php('}');
     $emptychild =& $this->find_child_by_class('list_default_tag');
     if ($emptychild) {
         $code->write_php(' else { ');
         $emptychild->generate_now($code);
         $code->write_php('}');
     }
     parent::post_generate($code);
 }
Example #23
0
 function generate_contents(&$code)
 {
     if (array_key_exists('even', $this->attributes)) {
         $code->write_php('if (!(' . $this->get_dataspace_ref_code() . '->get_counter()%2)) {');
         parent::generate_contents($code);
         $code->write_php('}');
     } elseif (array_key_exists('odd', $this->attributes)) {
         $code->write_php('if ((' . $this->get_dataspace_ref_code() . '->get_counter()%2)) {');
         parent::generate_contents($code);
         $code->write_php('}');
     }
 }
	function post_generate(&$code)
	{
	  $tab_class = $this->parent->tab_class;
	  
    $code->write_html("
  		</td>
  	</tr>
  	</table>	
	  ");
	
	  parent :: post_generate($code);
	}		
 function generate_contents(&$code)
 {
     if (array_key_exists('common', $this->attributes)) {
         $code->write_php('if (!(' . $this->get_dataspace_ref_code() . '->get("is_last"))) {');
         parent::generate_contents($code);
         $code->write_php('}');
     } elseif (array_key_exists('last', $this->attributes)) {
         $code->write_php('if ((' . $this->get_dataspace_ref_code() . '->get("is_last"))) {');
         parent::generate_contents($code);
         $code->write_php('}');
     }
 }
Example #26
0
 /**
  * 
  * @param code $ _writer
  * @return void 
  * @access protected 
  */
 function generate_contents(&$code)
 {
     $sep_child =& $this->find_immediate_child_by_class('list_separator_tag');
     $code->write_php('do { ');
     if ($sep_child) {
         $code->write_php('if (' . $this->get_component_ref_code() . '->show_separator) {');
         $sep_child->generate_now($code);
         $code->write_php('}');
         $code->write_php($this->get_component_ref_code() . '->show_separator = TRUE;');
     }
     parent::generate_contents($code);
     $code->write_php('} while (' . $this->get_dataspace_ref_code() . '->next());');
 }
 function generate_contents(&$code)
 {
     if (isset($this->attributes['locale_type'])) {
         if (strtolower($this->attributes['locale_type']) == 'content') {
             $locale_constant = 'CONTENT_LOCALE_ID';
         } else {
             $locale_constant = 'MANAGEMENT_LOCALE_ID';
         }
     } else {
         $locale_constant = 'MANAGEMENT_LOCALE_ID';
     }
     if (isset($this->attributes['hash_id'])) {
         $locale_tmp = '$' . $code->get_temp_variable();
         $code->write_php("{$locale_tmp} = " . $this->get_dataspace_ref_code() . '->get("' . $this->attributes['hash_id'] . '");');
         $code->write_php("echo currency :: locale_format({$locale_tmp}, constant('{$locale_constant}'));");
     }
     parent::generate_contents($code);
 }
 function generate_contents(&$code)
 {
     $ref = $this->get_component_ref_code();
     $code->write_html("<table border='0' cellpadding='0' cellspacing='0' height='100%'><tr><td>");
     $i = '$' . $code->get_temp_variable();
     $node_htm = '$' . $code->get_temp_variable();
     $level = '$' . $code->get_temp_variable();
     $levels_status = '$' . $code->get_temp_variable();
     $code->write_php("{$node_htm} = '';\r\n\t\t\t{$level} = {$ref}->get('level');\r\n\t\t\t{$levels_status} = {$ref}->get('levels_status');\r\n\t\t\t");
     $code->write_php("\r\n\t\t\tfor({$i}=1; {$i} < {$level}; {$i}++)\r\n\t\t\t{\r\n\t\t\t\tif(isset({$levels_status}[{$i}]) && {$levels_status}[{$i}])\r\n\t\t\t\t\t{$node_htm} .= \"" . TREE_SPACER_IMG . "\";\r\n\t\t\t\telse\r\n\t\t\t\t\t{$node_htm} .= \"" . TREE_LINE_IMG . "\";\r\n\t\t\t}\r\n\t\t");
     $open_params = '$' . $code->get_temp_variable();
     $close_params = '$' . $code->get_temp_variable();
     $open_link = '$' . $code->get_temp_variable();
     $close_link = '$' . $code->get_temp_variable();
     $anchor = '$' . $code->get_temp_variable();
     $next_img = '$' . $code->get_temp_variable();
     $tmp = '$' . $code->get_temp_variable();
     $code->write_php("\r\n\t\t\t{$open_params}['id'] = {$ref}->get('node_id'); \r\n\t\t\t{$open_params}['action'] = 'toggle';{$open_params}['expand'] = 1;\r\n\t\t\t{$close_params}['id'] = {$ref}->get('node_id');\r\n\t\t\t{$close_params}['action'] = 'toggle';{$close_params}['collapse'] = 1;\r\n\t\t\t{$anchor} = '#' . {$ref}->get('node_id');\r\n\t\t\t");
     $code->write_php("\r\n\t\t\tif({$ref}->get('is_last_child'))\r\n\t\t\t{\r\n\t\t\t\t{$open_link} = sprintf(\"" . TREE_END_P_IMG . "\", add_url_query_items(PHP_SELF, {$open_params}) . {$anchor});\r\n\t\t\t\t{$close_link} = sprintf(\"" . TREE_END_M_IMG . "\", add_url_query_items(PHP_SELF, {$close_params}) . {$anchor});\r\n\t\t\t\t{$next_img} = \"" . TREE_END_IMG . "\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t{$open_link} = sprintf(\"" . TREE_CROSS_P_IMG . "\", add_url_query_items(PHP_SELF, {$open_params}) . {$anchor});\r\n\t\t\t\t{$close_link} = sprintf(\"" . TREE_CROSS_M_IMG . "\", add_url_query_items(PHP_SELF, {$close_params}) . {$anchor});\r\n\t\t\t\t{$next_img} = \"" . TREE_CROSS_IMG . "\";\r\n\t\t\t}\r\n\t\t");
     $code->write_php("\r\n\t\t\tif(({$ref}->get('r')-{$ref}->get('l')) > 1)\r\n\t\t\t{\r\n\t\t\t\tif({$ref}->get('is_expanded'))\r\n\t\t\t\t\t{$node_htm} .= {$close_link};\r\n\t\t\t\telse\r\n\t\t\t\t\t{$node_htm} .= {$open_link};\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t\t{$node_htm} .= {$next_img};\r\n\t\t");
     $code->write_php("echo '<a name=' . {$ref}->get('node_id') . '>';");
     $code->write_php("echo {$node_htm};");
     $code->write_html("</td><td nowrap class='text'>");
     $img_alt = '$' . $code->get_temp_variable();
     $img_htm = '$' . $code->get_temp_variable();
     $code->write_php("\r\n\t\t\tif(!{$ref}->get('img_alt'))\r\n\t\t\t\t{$img_alt} = {$ref}->get('identifier');\r\n\t\t");
     $code->write_php("echo \r\n\t\t\t\"<table border=0 cellspacing=0 cellpadding=0 height=100% style='display:inline'>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><img src='/shared/images/1x1.gif' height=3 width=1></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>\";\r\n\t\t");
     $code->write_php("echo \r\n\t\t\t\"<img alt='{$img_alt}' border='0' align='middle' src='\" . {$ref}->get('icon') . \"'>\";\r\n\t\t");
     $code->write_php("echo \r\n\t\t\t\"</td></tr>\";\r\n\t\t");
     $code->write_php("\r\n\t\t\techo \"<tr><td height=100% \";\r\n\t\t\t\r\n\t\t\tif(({$ref}->get('r')-{$ref}->get('l')) > 1)\r\n\t\t\t{\r\n\t\t\t\tif({$ref}->get('is_expanded'))\r\n\t\t\t\t{\r\n\t\t\t\t\techo \" background='/shared/images/t_l.gif'\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\techo \"></td></tr>\";\r\n\t\t");
     $code->write_php("echo \"</table>\";");
     $code->write_html("</td><td valign=top style='padding:6px 3px 3px 2px'>");
     if (!array_key_exists('nolink', $this->attributes)) {
         $code->write_php("echo '<a href=' . {$ref}->get('path') . '>';");
     }
     $code->write_php("echo {$ref}->get('identifier');");
     if (!array_key_exists('nolink', $this->attributes)) {
         $code->write_php("echo '</a>';");
     }
     $code->write_html("</td></tr></table>");
     parent::generate_contents($code);
 }
Example #29
0
 function post_generate(&$code)
 {
     $js = '';
     if (isset($this->attributes['active_tab'])) {
         $active_tab = $this->attributes['active_tab'];
     } else {
         $active_tab = reset($this->tabs);
     }
     if (!$this->tabs || !$active_tab || !in_array($active_tab, $this->tabs)) {
         error('INVALID_TABS_DECLARATION', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('tag' => $this->tag, 'description' => 'check your tabs settings', 'file' => $this->source_file, 'line' => $this->starting_line_no));
     }
     foreach ($this->tabs as $id) {
         $js .= "var tab_data={'id':'{$id}'};\n tabs.register_tab_item(tab_data);\n";
     }
     if ($this->use_cookie) {
         $js .= "if (active_tab = get_cookie('active_tab'))\n\r\n                tabs.activate(active_tab);\n\r\n              else\r\n                tabs.activate('{$active_tab}');\n";
     } else {
         $js .= "tabs.activate('{$active_tab}');\n";
     }
     $code->write_html("\r\n      <script type='text/javascript'>\r\n        var tabs = new tabs_container();\r\n        {$js}\r\n      </script>");
     parent::post_generate($code);
 }
Example #30
0
	function generate_contents(&$code)
	{

		$file = 'common';
		
		if(isset($this->attributes['file']))
			$file = $this->attributes['file']; 
		
		if(isset($this->attributes['locale_type']))
		{
			if(strtolower($this->attributes['locale_type']) == 'content')
				$locale_constant = 'CONTENT_LOCALE_ID';	
			else
				$locale_constant = 'MANAGEMENT_LOCALE_ID';	
		}
		else
			$locale_constant = 'MANAGEMENT_LOCALE_ID';	

		if(isset($this->attributes['hash_id']))
		{
			$locale_tmp = '$' . $code->get_temp_variable();
			
			$code->write_php(
				"{$locale_tmp} = " . $this->get_dataspace_ref_code() . '->get("' . $this->attributes['hash_id'] . '");');

			$code->write_php("echo strings :: get({$locale_tmp}, '{$file}', constant('{$locale_constant}'));");
							
		}
		elseif(isset($this->attributes['name']))
		{			
			$code->write_php("echo strings :: get('{$this->attributes['name']}', '{$file}', constant('{$locale_constant}'));");
		}
		
				
		parent :: generate_contents($code);
	}