[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Search/ -> action.default.php (source)

   1  <?php
   2  if (!isset($gCms)) exit;
   3  
   4  $id = 'cntnt01';
   5  
   6  $origreturnid = $returnid;
   7  if( isset( $params['resultpage'] ) )
   8  {
   9      $manager =& $gCms->GetHierarchyManager();
  10      $node =& $manager->sureGetNodeByAlias($params['resultpage']);
  11      if (isset($node))
  12      {
  13          $content =& $node->GetContent();    
  14          if (isset($content))
  15          {
  16              $returnid = $content->Id();
  17          }
  18      }
  19      else
  20      {
  21          $node =& $manager->sureGetNodeById($params['resultpage']);
  22          if (isset($node))
  23          {
  24              $returnid = $params['resultpage'];
  25          }
  26      }
  27  }
  28  // Variable named hogan in honor of moorezilla's Rhodesian Ridgeback :) http://forum.cmsmadesimple.org/index.php/topic,9580.0.html
  29  $hogan = "onfocus=\"if(this.value==this.defaultValue) this.value='';\""." onBlur=\"if(this.value=='') this.value=this.defaultValue;\"";
  30  $submittext = (isset($params['submit'])) ? $params['submit'] : $this->Lang('searchsubmit');
  31  $searchtext = (isset($params['searchtext'])) ? $params['searchtext'] : $this->GetPreference('searchtext','');
  32  $this->smarty->assign('startform', $this->CreateFormStart($id, 'dosearch', $returnid, 'get'));
  33  $this->smarty->assign('label', '<label for="'.$id.'searchinput">'.$this->Lang('search').'</label>');
  34  $this->smarty->assign('inputbox', $this->CreateInputText($id, 'searchinput', $searchtext, 20, 50, $hogan));
  35  $this->smarty->assign('submitbutton', $this->CreateInputSubmit($id, 'submit', $submittext));
  36  $this->smarty->assign('submittext', $submittext);
  37  
  38  if( $origreturnid != $returnid )
  39      $this->smarty->assign('hidden', $this->CreateInputHidden($id, 'origreturnid', $origreturnid ));
  40  else
  41      $this->smarty->assign('hidden', '');
  42  $this->smarty->assign('endform', $this->CreateFormEnd());
  43  
  44  echo $this->ProcessTemplateFromDatabase('displaysearch');
  45  
  46  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7