Source for file AddTemplate.php

Documentation is available at AddTemplate.php

  1. <?php
  2. // vim: foldmethod=marker
  3. /**
  4.  *  AddTemplate.php
  5.  *
  6.  *  @author     nnno <nnno@nnno.jp>
  7.  *  @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
  8.  *  @package    Ethna
  9.  */
  10.  
  11. require_once 'Ethna/class/Plugin/Handle/AddView.php';
  12.  
  13. // {{{ Ethna_Plugin_Handle_AddTemplate
  14. /**
  15.  *  add-template handler
  16.  *
  17.  *  @author     nnno <nnno@nnno.jp>
  18.  *  @access     public
  19.  *  @package    Ethna
  20.  */
  21. {
  22.     /**
  23.      *  add template
  24.      *
  25.      *  @access public
  26.      */
  27.     function perform()
  28.     {
  29.         $r $this->_getopt(
  30.                   array('basedir=',
  31.                         'skelfile=',
  32.                         'locale=',
  33.                         'encoding=',
  34.                   )
  35.               )
  36.         if (Ethna::isError($r)) {
  37.             return $r;
  38.         }
  39.         list($opt_list$arg_list$r;
  40.  
  41.         // template
  42.         $template array_shift($arg_list);
  43.         if ($template == null{
  44.             return Ethna::raiseError('template name isn\'t set.''usage');
  45.         }
  46.         $r Ethna_Controller::checkViewName($template)// XXX: use checkViewName().
  47.         if (Ethna::isError($r)) {
  48.             return $r;
  49.         }
  50.  
  51.         // add template
  52.         $ret $this->_performTemplate($template$opt_list);
  53.         return $ret;
  54.     }
  55.  
  56.     /**
  57.      *  get handler's description
  58.      *
  59.      *  @access public
  60.      */
  61.     function getDescription()
  62.     {
  63.         return <<<EOS
  64. add new template to project:
  65.     {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-l|--locale=locale] [-e|--encoding] [template]
  66.  
  67. EOS;
  68.     }
  69.  
  70.     /**
  71.      *  @access public
  72.      */
  73.     function getUsage()
  74.     {
  75.         return <<<EOS
  76. ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [-l|--locale=locale] [-e|--encoding] [template]
  77. EOS;
  78.     }
  79. }
  80. // }}}

Documentation generated on Fri, 11 Nov 2011 03:57:28 +0900 by phpDocumentor 1.4.3