<?php /********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class HintTitleTagInfo { var $tag = 'hint:TITLE'; var $end_tag = ENDTAG_REQUIRED; var $tag_class = 'hint_title_tag'; } registerTag(new HintTitleTagInfo()); class HintTitleTag extends CompilerDirectiveTag { }
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class LocaleLocaleTagInfo { public $tag = 'locale:LOCALE'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'locale_locale_tag'; } registerTag(new LocaleLocaleTagInfo()); class LocaleLocaleTag extends CompilerDirectiveTag { function preParse() { if (!isset($this->attributes['name']) || !$this->attributes['name']) { throw new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'name', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } return PARSER_REQUIRE_PARSING;
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class CoreIncludeTagInfo { public $tag = 'core:INCLUDE'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'core_include_tag'; } registerTag(new CoreIncludeTagInfo()); /** * Include another template into the current template */ class CoreIncludeTag extends CompilerDirectiveTag { protected $resolved_source_file; public function preParse() { global $tag_dictionary; if (! array_key_exists('file', $this->attributes) || empty($this->attributes['file'])) { throw new WactException('missing required attribute',
<?php /********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class PollFormTagInfo { public $tag = 'poll:FORM'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'poll_form_tag'; } registerTag(new PollFormTagInfo()); class PollFormTag extends CompilerDirectiveTag { }
/********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class TabItemContentTagInfo { public $tag = 'tab_item:content'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'tab_item_content_tag'; } registerTag(new TabItemContentTagInfo()); class TabItemContentTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->parent instanceof TabsContentsTag) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'tabs:contents', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } } public function preParse() { if (!isset($this->attributes['tab_id'])) { throw new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'id', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (!in_array($this->attributes['tab_id'], $this->parent->parent->tabs)) { throw new WactException('invalid attribute value', array('tag' => $this->tag, 'attribute' => 'tab_id', 'description' => 'tab_id not declared in <tab_item:label> tag', 'file' => $this->source_file, 'line' => $this->starting_line_no));
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class PagerSectionTagInfo { public $tag = 'pager:section'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'pager_section_tag'; } registerTag(new PagerSectionTagInfo()); class PagerSectionTag extends ServerComponentTag { public function checkNestingLevel() { if ($this->findParentByClass('pager_section_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (!$this->findParentByClass('pager_navigator_tag')) { throw new WactException('missing enclosure',
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridSelectorsTogglerTagInfo { public $tag = 'grid:SELECTORS_TOGGLER'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'grid_selectors_toggler_tag'; } registerTag(new GridSelectorsTogglerTagInfo()); class GridSelectorsTogglerTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->findParentByClass('grid_list_tag')) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'grid:LIST', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } }
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ require_once(LIMB_DIR . '/class/template/tags/form/Button.tag.php'); class GridButtonTagInfo { public $tag = 'grid:BUTTON'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'grid_button_tag'; } registerTag(new GridButtonTagInfo()); class GridButtonTag extends ButtonTag { public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/form/grid_button_component'; } public function checkNestingLevel() { if (!$this->findParentByClass('grid_list_tag')) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'grid:LIST',
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class StatusPublishedTagInfo { public $tag = 'status:PUBLISHED'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'status_published_tag'; } registerTag(new StatusPublishedTagInfo()); /** * Defines an action take, should a dataspace variable have been set at runtime. * The opposite of the core_default_tag */ class StatusPublishedTag extends CompilerDirectiveTag { public function preGenerate($code) { parent::preGenerate($code); $value = 'true'; if (isset($this->attributes['value']) && !(boolean)$this->attributes['value']) $value = 'false';
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class PagerPrevTagInfo { public $tag = 'pager:PREV'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'pager_prev_tag'; } registerTag(new PagerPrevTagInfo()); class PagerPrevTag extends ServerComponentTag { protected $hide_for_current_page; function checkNestingLevel() { if ($this->findParentByClass('pager_prev_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (!$this->findParentByClass('pager_navigator_tag'))
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridListTagInfo { public $tag = 'grid:LIST'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'grid_list_tag'; } registerTag(new GridListTagInfo()); /** * The parent compile time component for lists */ class GridListTag extends ServerComponentTag { protected $has_form = false; public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/list_component'; } public function preGenerate($code) {
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class CoreBlockTagInfo { public $tag = 'core:BLOCK'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'core_block_tag'; } registerTag(new CoreBlockTagInfo()); class CoreBlockTag extends ServerComponentTag { public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/block_component'; } public function generateConstructor($code) { parent::generateConstructor($code); if (array_key_exists('hide', $this->attributes)) { $code->writePhp($this->getComponentRefCode() . '->visible = false;'); }
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridSiteMapTreeItemTagInfo { public $tag = 'grid:SITE_MAP_TREE_ITEM'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'grid_site_map_tree_item_tag'; } registerTag(new GridSiteMapTreeItemTagInfo()); class GridSiteMapTreeItemTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->parent instanceof GridIteratorTag) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'grid:ITERATOR', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } }
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ require_once(LIMB_DIR . '/class/template/tags/form/ControlTag.class.php'); class JsCheckboxTagInfo { public $tag = 'js_checkbox'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'js_checkbox_tag'; } registerTag(new JsCheckboxTagInfo()); class JsCheckboxTag extends ControlTag { public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/form/js_checkbox_component'; } public function getRenderedTag() { return 'input'; } public function preGenerate($code) {
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ require_once(LIMB_DIR . '/class/template/tags/form/ControlTag.class.php'); class DateTagInfo { public $tag = 'date'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'date_tag'; } registerTag(new DateTagInfo()); class DateTag extends ControlTag { public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/form/date_component'; } public function getRenderedTag() { return 'input'; } public function preGenerate($code) {
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class PagerNumberTagInfo { public $tag = 'pager:NUMBER'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'pager_number_tag'; } registerTag(new PagerNumberTagInfo()); class PagerNumberTag extends ServerComponentTag { public function checkNestingLevel() { if ($this->findParentByClass('pager_number_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (!$this->findParentByClass('pager_navigator_tag')) { throw new WactException('missing enclosure',
/********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class TabsContentsTagInfo { var $tag = 'tabs:contents'; var $end_tag = ENDTAG_REQUIRED; var $tag_class = 'tabs_contents_tag'; } registerTag(new TabsContentsTagInfo()); class TabsContentsTag extends CompilerDirectiveTag { function checkNestingLevel() { if (!is_a($this->parent, 'TabsTag')) { return throw_error(new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'tabs', 'file' => $this->source_file, 'line' => $this->starting_line_no))); } } function preGenerate($code) { $code->writeHtml("\r\n <table>\r\n <tr>\r\n <td height=100% valign=top>\r\n "); parent::preGenerate($code); } function postGenerate($code) {
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class LocaleNumberFormatTagInfo { public $tag = 'locale:NUMBER_FORMAT'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'locale_number_format_tag'; } registerTag(new LocaleNumberFormatTagInfo()); class LocaleNumberFormatTag extends ServerComponentTag { protected $field; public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/locale_number_format_component'; } public function preParse() { if (!isset($this->attributes['hash_id']) || !$this->attributes['hash_id']) { throw new WactException('missing required attribute',
/********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class ConstOptionalTagInfo { public $tag = 'const:OPTIONAL'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'const_optional_tag'; } registerTag(new ConstOptionalTagInfo()); class ConstOptionalTag extends CompilerDirectiveTag { protected $const; public function preParse() { if (!isset($this->attributes['name'])) { throw new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'name', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } $this->const = $this->attributes['name']; return PARSER_REQUIRE_PARSING; } public function preGenerate($code) { $value = 'true'; if (isset($this->attributes['value']) && !(bool) $this->attributes['value']) {
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class FormErrorStatusTagInfo { public $tag = 'form:ERROR_STATUS'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'error_status_tag'; } registerTag(new FormErrorStatusTagInfo()); class ErrorStatusTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->findParentByClass('form_status_tag')) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'form_status', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } } }
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class PagerFirstTagInfo { public $tag = 'pager:FIRST'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'pager_first_tag'; } registerTag(new PagerFirstTagInfo()); /** * Compile time component for "back to start" element of pager. */ class PagerFirstTag extends ServerComponentTag { protected $hide_for_current_page; public function checkNestingLevel() { if ($this->findParentByClass('pager_first_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file,
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class FormSuccessStatusTagInfo { public $tag = 'form:SUCCESS_STATUS'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'success_status_tag'; } registerTag(new FormSuccessStatusTagInfo()); class SuccessStatusTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->findParentByClass('form_status_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } } }
/********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class TabsTagInfo { var $tag = 'tabs'; var $end_tag = ENDTAG_REQUIRED; var $tag_class = 'tabs_tag'; } registerTag(new TabsTagInfo()); class TabsTag extends CompilerDirectiveTag { public $tabs = array(), $tabulator_class = 'class="tabulator"', $tab_class = 'class="tab"', $active_tab_class = 'class="active-tab"', $use_cookie = false; function prepare() { if (isset($this->attributes['active_tab'])) { $this->active_tab = $this->attributes['active_tab']; } else { $this->active_tab = null; } if (isset($this->attributes['class'])) { $this->tabulator_class = 'class="' . $this->attributes['class'] . '"'; } if (isset($this->attributes['tab_class'])) { $this->tab_class = 'class="' . $this->attributes['tab_class'] . '"';
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class FormTagInfo { public $tag = 'form'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'form_tag'; } registerTag(new FormTagInfo()); /** * Compile time component for building runtime form_components */ class FormTag extends ServerTagComponentTag { function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/form/form_component'; } /** * Returns the identifying server ID. It's value it determined in the * following order; * <ol>
* Copyright 2004 BIT, Ltd. http://www.0x00.ru, mailto: bit@0x00.ru * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridActionTagInfo { public $tag = 'grid:action'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'grid_action_tag'; } registerTag(new GridActionTagInfo()); class GridActionTag extends CompilerDirectiveTag { public function checkNestingLevel() { if (!$this->parent instanceof GridActionsTag) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'gird:actions', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } }
/********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class UserNotInGroupsTagInfo { public $tag = 'user:NOT_IN_GROUPS'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'user_not_in_groups_tag'; } registerTag(new UserNotInGroupsTagInfo()); class UserNotInGroupsTag extends ServerComponentTag { public function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/simple_authenticator_component'; } public function preParse() { if (!isset($this->attributes['groups']) || !$this->attributes['groups']) { throw new WactException('missing required attribute', array('tag' => $this->tag, 'attribute' => 'groups', 'file' => $this->source_file, 'line' => $this->starting_line_no)); } return PARSER_REQUIRE_PARSING; } public function generateContents($code) {
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridDefaultTagInfo { public $tag = 'grid:DEFAULT'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'grid_default_tag'; } registerTag(new GridDefaultTagInfo()); class GridDefaultTag extends SilentCompilerDirectiveTag { public function checkNestingLevel() { if ($this->findParentByClass('grid_default_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); } if (!$this->parent instanceof GridListTag) { throw new WactException('missing enclosure',
* Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class GridSeparatorTagInfo { public $tag = 'grid:SEPARATOR'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'grid_separator_tag'; } registerTag(new GridSeparatorTagInfo()); class GridSeparatorTag extends CompilerDirectiveTag { protected $count; public function checkNestingLevel() { if ($this->findParentByClass('grid_separator_tag')) { throw new WactException('bad self nesting', array('tag' => $this->tag, 'file' => $this->source_file, 'line' => $this->starting_line_no)); }
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ require_once(LIMB_DIR . '/class/template/tags/form/ControlTag.class.php'); class GridSelectorTagInfo { public $tag = 'grid:SELECTOR'; public $end_tag = ENDTAG_FORBIDDEN; public $tag_class = 'grid_selector_tag'; } registerTag(new GridSelectorTagInfo()); class GridSelectorTag extends ControlTag { function __construct() { $this->runtime_component_path = dirname(__FILE__) . '/../../components/form/grid_checkbox_component'; } public function checkNestingLevel() { if (!$this->findParentByClass('grid_iterator_tag')) { throw new WactException('missing enclosure', array('tag' => $this->tag, 'enclosing_tag' => 'grid:ITERATOR',
<?php /********************************************************************************** * Copyright 2004 BIT, Ltd. http://limb-project.com, mailto: support@limb-project.com * * Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) *********************************************************************************** * * $Id$ * ***********************************************************************************/ class UserNotLoggedInTagInfo { public $tag = 'user:NOT_LOGGED_IN'; public $end_tag = ENDTAG_REQUIRED; public $tag_class = 'user_not_logged_in_tag'; } registerTag(new UserNotLoggedInTagInfo()); class UserNotLoggedInTag extends CompilerDirectiveTag { public function generateContents($code) { $code->writePhp("if (!Limb :: toolkit()->getUser()->is_logged_in()) {"); parent::generateContents($code); $code->writePhp("}"); } }