public function generateContents($code) { $dataspace = $this->getDataspaceRefCode(); $counter = '$' . $code->getTempVariable(); $value = '$' . $code->getTempVariable(); if (isset($this->attributes['hash_id'])) { $code->writePhp($value . ' = trim(' . $this->getDataspaceRefCode() . '->get(\'' . $this->attributes['hash_id'] . '\'));'); } else { if(!isset($this->attributes['value'])) $this->attributes['value'] = 1; $code->writePhp($value . ' = ' . $this->attributes['value'] . ';'); } $code->writePhp('for(' . $counter . '=0;' . $counter . ' < ' . $value . '; ' . $counter . '++){'); parent :: generateContents($code); $code->writePhp('}'); }
public function generateContents($code) { $code->writePhp('do { '); parent::generateContents($code); $code->writePhp('} while (' . $this->getDataspaceRefCode() . '->next());'); }
function generateContents(&$code) { $parent =& $this->findParentByClass('LimbPagerNavigatorTag'); $code->writePhp('if (' . $parent->getComponentRefCode() . '->hasNext()) {'); parent :: generateContents($code); $code->writePhp('}'); }
public function generateContents($code) { $value = $this->_typecastValue(); $code->writePhp($this->parent->getComponentRefCode() . '->set_parameter("' . $this->attributes['name'] . '", ' . var_export($value, true) . ')'); parent::generateContents($code); }
function generateContents(&$code) { $counter = '$' . $code->getTempVariable(); $value = $this->getAttribute('value'); $code->writePhp('for(' . $counter . '=0;' . $counter . ' < ' . $value . '; ' . $counter . '++){'); parent :: generateContents($code); $code->writePhp('}'); }
function generateContents(&$code) { $parent =& $this->findParentByClass('LimbPagerNavigatorTag'); $code->writePhp('if (!' . $parent->getComponentRefCode() . '->isDisplayedPage()) {'); $code->writePhp($this->getDataSourceRefCode() . '->set("href", ' . $parent->getComponentRefCode() . '->getPageUri());'); $code->writePhp($this->getDataSourceRefCode() . '->set("number", ' . $parent->getComponentRefCode() . '->getPage());'); parent :: generateContents($code); $code->writePhp('}'); }
public function generateContents($code) { if($this->isDebugEnabled()) { $code->writeHtml("<div class='debug-tmpl-include'>"); $this->_generateDebugEditorLinkHtml($code, $this->resolved_source_file); } parent :: generateContents($code); if($this->isDebugEnabled()) $code->writeHtml('</div>'); }
public function generateContents($code) { $dataspace = $this->getDataspaceRefCode(); if (isset($this->attributes['hash_id']) && isset($this->attributes['target'])) { if($target = $this->parent->findChild($this->attributes['target'])) { $code->writePhp($target->getComponentRefCode() . '->register_dataset(new array_dataset(' . $dataspace . '->get("' . $this->attributes['hash_id'] . '")))'); } } parent :: generateContents($code); }
public function generateContents($code) { $mapped = '$' . $code->getTempVariable(); $code->writePhp("{$mapped} = Limb :: toolkit()->getFetcher()->fetchRequestedObject(Limb :: toolkit()->getRequest());"); $code->writePhp("if(isset({$mapped}['actions']) && array_key_exists('print_version', {$mapped}['actions'])){"); $code->writePhp($this->getDataspaceRefCode() . "->set('link', {$mapped}['path'] . '?action=print_version');"); parent :: generateContents($code); $code->writePhp('}'); }
public function generateContents($code) { if (array_key_exists('even', $this->attributes)) { $code->writePhp('if (!(' . $this->getDataspaceRefCode() . '->get_counter()%2)) {'); parent :: generateContents($code); $code->writePhp('}'); } elseif (array_key_exists('odd', $this->attributes)) { $code->writePhp('if ((' . $this->getDataspaceRefCode() . '->get_counter()%2)) {'); parent :: generateContents($code); $code->writePhp('}'); } }
public function generateContents($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->getTempVariable(); $code->writePhp( "{$locale_tmp} = " . $this->getDataspaceRefCode() . '->get("' . $this->attributes['hash_id'] . '");'); if(defined('DEBUG_TEMPLATE_I18N_ENABLED') && constant('DEBUG_TEMPLATE_I18N_ENABLED')) { $code->writePhp(" echo '<img src=\'/shared/images/i.gif\' title=\''{$locale_tmp}' from '{$file}_???' i18n file\'>';" ); } $code->writePhp("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->writePhp(" echo '<img src=\'/shared/images/i.gif\' title=\''{$this->attributes['name']}' from '{$file}_???' i18n file\'>';" ); } $code->writePhp("echo strings :: get('{$this->attributes['name']}', '{$file}', constant('{$locale_constant}'));"); } parent :: generateContents($code); }
function generateContents(&$code) { $dataspace =& $this->getDataSourceRefCode(); $target_name = $this->getAttribute('target'); $from = $this->getAttribute('from'); if (!empty($from) && !empty($target_name)) { if($target =& $this->parent->findChild($target_name)) { $code->writePhp($target->getComponentRefCode() . '->registerDataSet(new PagedArrayDataset(' . $dataspace . '->get("' . $from . '")));'); } } parent :: generateContents($code); }
public function generateContents($code) { $ref = $this->getComponentRefCode(); $code->writeHtml("<table border='0' cellpadding='0' cellspacing='0' height='100%'><tr><td>"); $i = '$' . $code->getTempVariable(); $node_htm = '$' . $code->getTempVariable(); $level = '$' . $code->getTempVariable(); $levels_status = '$' . $code->getTempVariable(); $code->writePhp( "{$node_htm} = ''; {$level} = {$ref}->get('level'); {$levels_status} = {$ref}->get('levels_status'); " ); $code->writePhp(" for({$i}=1; {$i} < {$level}; {$i}++) { if(isset({$levels_status}[{$i}]) && {$levels_status}[{$i}]) {$node_htm} .= \"" . TREE_SPACER_IMG . "\"; else {$node_htm} .= \"" . TREE_LINE_IMG . "\"; } "); $open_params = '$' . $code->getTempVariable(); $close_params = '$' . $code->getTempVariable(); $open_link = '$' . $code->getTempVariable(); $close_link = '$' . $code->getTempVariable(); $anchor = '$' . $code->getTempVariable(); $next_img = '$' . $code->getTempVariable(); $tmp = '$' . $code->getTempVariable(); $code->writePhp(" {$open_params}['id'] = {$ref}->get('node_id'); {$open_params}['action'] = 'toggle';{$open_params}['expand'] = 1; {$close_params}['id'] = {$ref}->get('node_id'); {$close_params}['action'] = 'toggle';{$close_params}['collapse'] = 1; {$anchor} = '#' . {$ref}->get('node_id'); " ); $code->writePhp(" if({$ref}->get('is_last_child')) { {$open_link} = sprintf(\"" . TREE_END_P_IMG . "\", addUrlQueryItems(\$_SERVER['PHP_SELF'], {$open_params}) . {$anchor}); {$close_link} = sprintf(\"" . TREE_END_M_IMG . "\", addUrlQueryItems(\$_SERVER['PHP_SELF'], {$close_params}) . {$anchor}); {$next_img} = \"" . TREE_END_IMG . "\"; } else { {$open_link} = sprintf(\"" . TREE_CROSS_P_IMG . "\", addUrlQueryItems(\$_SERVER['PHP_SELF'], {$open_params}) . {$anchor}); {$close_link} = sprintf(\"" . TREE_CROSS_M_IMG . "\", addUrlQueryItems(\$_SERVER['PHP_SELF'], {$close_params}) . {$anchor}); {$next_img} = \"" . TREE_CROSS_IMG . "\"; } "); $code->writePhp(" if(({$ref}->get('r')-{$ref}->get('l')) > 1) { if({$ref}->get('is_expanded')) {$node_htm} .= {$next_img}; else {$node_htm} .= {$next_img}; } else {$node_htm} .= {$next_img}; "); $code->writePhp("echo '<a name=' . {$ref}->get('node_id') . '>';"); $code->writePhp("echo {$node_htm};"); $code->writeHtml("</td><td nowrap class='text'>"); $img_alt = '$' . $code->getTempVariable(); $img_htm = '$' . $code->getTempVariable(); $code->writePhp(" if(!{$ref}->get('img_alt')) {$img_alt} = {$ref}->get('identifier'); "); $code->writePhp("echo \"<table border=0 cellspacing=0 cellpadding=0 height=100% style='display:inline'> <tr> <td><img src='/shared/images/1x1.gif' height=3 width=1></td> </tr> <tr> <td>\"; "); $code->writePhp("echo \"</td></tr>\"; "); $code->writePhp(" echo \"<tr><td height=100% \"; if(({$ref}->get('r')-{$ref}->get('l')) > 1) { if({$ref}->get('is_expanded')) { echo \" background='/shared/images/t_l.gif'\"; } } echo \"></td></tr>\"; "); $code->writePhp("echo \"</table>\";"); $code->writeHtml("</td><td valign=top style='padding:6px 3px 3px 2px'>"); if(!array_key_exists('nolink', $this->attributes)) $code->writePhp("echo '<a href=' . {$ref}->get('url') . '>';"); $code->writePhp("echo {$ref}->get('title');"); if(!array_key_exists('nolink', $this->attributes)) $code->writePhp("echo '</a>';"); $code->writeHtml("</td></tr></table>"); parent::generateContents($code); }
public function generateContents($code) { $code->writePhp("if (!Limb :: toolkit()->getUser()->is_logged_in()) {"); parent::generateContents($code); $code->writePhp("}"); }
public function generateContents($code) { $code->writePhp("echo Limb :: toolkit()->getUser()->get('{$this->attributes['name']}');"); parent::generateContents($code); }