public function preGenerate($code)
	{	  	  
		$grid_tag = $this->findParentByClass('grid_list_tag');
		$grid_tag->setFormRequired();

	  parent :: preGenerate($code);
	}
  public function preGenerate($code)
  {
    parent::preGenerate($code);

    $parent = $this->findParentByClass('pager_navigator_tag');
    $code->writePhp('if (' . $parent->getComponentRefCode() . '->next()) {');
  }
  function preGenerate(&$code)
  {
    parent::preGenerate($code);

    $parent =& $this->findParentByClass('LimbPagerNavigatorTag');
    $code->writePhp('while (' . $parent->getComponentRefCode() . '->isValid()) {');
  }
 public function preGenerate($code)
 {
   parent::preGenerate($code);
   $tempvar = $code->getTempVariable();
   $code->writePhp('$' . $tempvar . ' = trim(' . $this->getDataspaceRefCode() . '->get(\'' . $this->attributes['for'] . '\'));');
   $code->writePhp('if (empty($' . $tempvar . ')) {');
 }
  public function preGenerate($code)
  {
    if(!isset($this->attributes['type']))
      $this->attributes['type'] = 'string';

    parent::preGenerate($code);
  }
 public function preGenerate($code)
 {
     $value = 'true';
     if (isset($this->attributes['value']) && !(bool) $this->attributes['value']) {
         $value = 'false';
     }
     $code->writePhp('if (defined("' . $this->const . '") && (constant("' . $this->const . '")) === ' . $value . ') {');
     parent::preGenerate($code);
 }
  /**
  * Calls the parent pre_generate() method then writes
  * "$dataspace->prepare();" to the compiled template.
  */
  public function preGenerate($code)
  {
    parent::preGenerate($code);

    if($this->isDebugEnabled())
    {
      $code->writeHtml("<div class='debug-tmpl-main'>");

      $this->_generateDebugEditorLinkHtml($code, $this->source_file);
    }
  }
  public function preGenerate($code)
  {
    $value = 'true';
    if (isset($this->attributes['value']) &&  !(boolean)$this->attributes['value'])
      $value = 'false';

    $tempvar = $code->getTempVariable();
    $code->writePhp('$' . $tempvar . ' = trim(' . $this->getDataspaceRefCode() . '->get("status"));');
    $code->writePhp('if ((boolean)(constant("' . $this->const . '") & $' . $tempvar . ') === ' . $value . ') {');

    parent::preGenerate($code);
  }
  public function preGenerate($code)
  {
    parent::preGenerate($code);

    $counter = '$' . $code->getTempVariable();

    $code->writePhp($counter . ' = trim(' . $this->getDataspaceRefCode() . '->get_counter());');

    $code->writePhp(
        "if (	($counter > 0) &&
              ($counter < " . $this->getDataspaceRefCode() . "->get_total_row_count()) &&
              ($counter % " . $this->count . " == 0)) {");
  }
  /**
  * @param CodeWriter
  * @return void
  * @access protected
  */
  function preGenerate(&$code) {
    parent::preGenerate($code);

    $tempvar = $code->getTempVariable();
    $this->DBE->generatePreStatement($code);
    $code->writePHP('$' . $tempvar . ' = ');
    $this->DBE->generateExpression($code);
        $code->writePHP(';');
    $this->DBE->generatePostStatement($code);

    $code->writePHP('if (!is_array($' . $tempvar .' )) $' . $tempvar . '= trim($' . $tempvar . ');');
    $code->writePHP('if (!empty($' . $tempvar . ')){');
  }
  function preGenerate(&$code)
  {
    parent::preGenerate($code);

    $this->tempvar = $code->getTempVarRef();

    $toolkit_var = $code->getTempVarRef();
    $user_var = $code->getTempVarRef();

    $code->writePHP($toolkit_var . " =& Limb :: toolkit();\n");
    $code->writePHP($user_var . " =& ". $toolkit_var . "->getUser();\n");
    $code->writePHP('if (' . $user_var. '->isLoggedIn() ){');
  }
  function preGenerate(&$code)
  {
    $this->hide_for_current_page = $this->getBoolAttribute('hide_for_current_page');

    $parent = $this->findParentByClass('LimbPagerNavigatorTag');
    $code->writePhp('if (!' . $parent->getComponentRefCode() . '->isFirst()) {');

    parent::preGenerate($code);

    $code->writePhp($this->getDataSourceRefCode() . '->set("href", ' . $parent->getComponentRefCode() . '->getFirstPageUri());');
    if (!$this->hide_for_current_page)
    {
      $code->writePhp('}');
    }
  }
  public function preGenerate($code)
  {
    parent::preGenerate($code);

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

    $code->writePhp('if ("' . $this->attributes['name']. '" == constant("'. $locale_constant .'")) {');
  }
  public function preGenerate($code)
  {
    parent::preGenerate($code);

    $value = 'true';
    if (isset($this->attributes['value']) &&  !(boolean)$this->attributes['value'])
      $value = 'false';

    $tempvar = $code->getTempVariable();
    $actions_tempvar = $code->getTempVariable();
    $code->writePhp('$' . $actions_tempvar . ' = ' . $this->getDataspaceRefCode() . '->get("actions");');

    $code->writePhp('if (isset($' . $actions_tempvar . '["publish"]) && isset($' . $actions_tempvar . '["unpublish"])) {');
    $code->writePhp('$' . $tempvar . ' = trim(' . $this->getDataspaceRefCode() . '->get("status"));');
    $code->writePhp('if ((boolean)(site_object :: STATUS_PUBLISHED & $' . $tempvar . ') === ' . $value . ') {');
  }
  function preGenerate(&$code)
  {
    parent::preGenerate($code);

    if($locale_type = $this->getAttribute('locale_type'))
    {
      if(strtolower($locale_type) == 'management')
        $locale_constant = 'MANAGEMENT_LOCALE_ID';
      else
        $locale_constant = 'CONTENT_LOCALE_ID';
    }
    else
        $locale_constant = 'CONTENT_LOCALE_ID';

    $name = $this->getAttribute('name');
    $code->writePhp('if ("' . $name. '" == constant("'. $locale_constant .'")) {');
  }
  function preGenerate(&$code)
  {
    parent::preGenerate($code);

    $this->counter_var =& $code->getTempVarRef();
    $total_var =& $code->getTempVarRef();

    $code->writePhp('if(empty(' . $this->counter_var . '))'. "\n");
    $code->writePhp($this->counter_var .' = 0; ' . "\n");

    $code->writePhp('if(empty(' . $total_var . '))'. "\n");
    $code->writePhp($total_var .' = ' . $this->getComponentRefCode() . '->dataSet->getTotalRowCount();' . "\n");

    $code->writePhp($this->counter_var . '++;'. "\n");

    $code->writePhp(
        'if (	(' . $this->counter_var . ' > 0) && (' . $this->getComponentRefCode() . '->dataSet->valid()) '.
              '&& ' . $this->counter_var . '< ' . $total_var .
              '&& (' . $this->counter_var . ' % ' . $this->step . ' == 0)) {'. "\n");
  }
  public function preGenerate($code)
  {
    $value = '$' . $code->getTempVariable();
    $parent = $this->getDataspaceRefCode();

    $radio_child = $this->findChildByClass('input_tag');
    $label_child = $this->findChildByClass('label_tag');

    $radio = $radio_child->getComponentRefCode();
    $label = $label_child->getComponentRefCode();


    $code->writePhp("
    if ({$value} = {$parent}->get('id'))
    {
      {$radio}->set_attribute('value', {$value});
      {$radio}->set_attribute('id', {$value});
      {$label}->set_attribute('for', {$value});
    }
    ");

    parent :: preGenerate($code);
  }
 public function preGenerate($code)
 {
     $id = $this->attributes['tab_id'];
     $code->writeHtml("<div id='{$id}_content'>");
     parent::preGenerate($code);
 }
 function preGenerate($code)
 {
     $this->_loadTabsJsScript($code);
     parent::preGenerate($code);
 }
  function preGenerate(&$code)
  {
    $code->writePHP($this->getComponentRefCode() . '->preserveState("' . $this->getAttribute('name') . '");');

    parent :: preGenerate($code);
  }
 function preGenerate($code)
 {
     $code->writeHtml("\r\n      <table>\r\n      <tr>\r\n        <td height=100% valign=top>\r\n    ");
     parent::preGenerate($code);
 }
  public function preGenerate($code)
  {
    parent::preGenerate($code);

    $code->writePhp('if (' . $this->getComponentRefCode() . '->next()) {');
  }
    public function preGenerate($code)
    {
        $js = <<<JS
<script language="javascript">
dom = (document.getElementById) ? true : false;
nn4 = (document.hints) ? true : false;
ie = (document.all) ? true : false;
ie4 = ie && !dom;

var current_hint_x = -1, current_hint_y = -1;
var current_hint_id = null;

//document.onmousemove = hint_mouse_move_handler;
addEvent(document, 'mousemove', hint_mouse_move_handler);

function hintMouseMoveHandler(e)
{
  if (dom)
  {
    current_hint_x = e.clientX;
    current_hint_y = e.clientY;
  }
  else if(ie4)
  {
    current_hint_x = e.x + document.body.scrollLeft;
    current_hint_y = e.y + document.body.scrollTop;
  }
  else if(nn4)
  {
    current_hint_x = e.pageX;
    current_hint_y = e.pageY;
  }

  on_hint_mouse_move();
}

function on_hint_mouse_move()
{
  if(current_hint_id)
    moveHint(current_hint_id, current_hint_x+10, current_hint_y+10);
}

function showHint(id)
{
  if (dom)
  {
    document.getElementById(id).style.visibility = "visible";
    document.getElementById(id).style.display = '';
  }
  else if (ie4)
  {
    document.all[id].style.visibility = "visible";
    document.all[id].style.display= '';
  }
  else if (nn4)
  {
    document.hints[id].visibility = "show";
    document.hints[id].display='';
  }
}

function hideHint(id)
{
  if (dom) document.getElementById(id).style.visibility = "hidden";
  else if (ie4) document.all[id].style.visibility = "hidden";
  else if (nn4) document.hints[id].visibility = "hide";
}

function moveHint(id,x,y)
{
  if (dom)
  {
    h = document.getElementById(id);
    h.style.left = x;
    h.style.top = y;
  }
  else if(ie4)
  {
    document.all[id].left = x;
    document.all[id].top = y;
  }
  else if(nn4)
  {
    document.hints[id].left = x;
    document.hints[id].top = y;
  }
}

function startHint(id)
{
  if(current_hint_id)
    hideHint(current_hint_id);

  current_hint_id = id;

  moveHint(current_hint_id, current_hint_x+10, current_hint_y+10);
  showHint(current_hint_id);
}

function stop_hint()
{
  hideHint(current_hint_id);
  current_hint_id = null;
}
</script>
JS;
        parent::preGenerate($code);
        if (!defined('HINT_SCRIPT_INCLUDED')) {
            $code->writeHtml($js);
            define('HINT_SCRIPT_INCLUDED', true);
        }
    }
 function preGenerate($code)
 {
     $id = $this->attributes['tab_id'];
     $code->writeHtml("<td id={$id}>\r\n          <table border='0' cellspacing='0' cellpadding='0' style='height:100%'>\r\n          <tr>\r\n            <td nowrap {$this->parent->parent->tab_class}><a href='JavaScript:void(0);'>");
     parent::preGenerate($code);
 }