Source for file Ethna_Plugin_Handle_AddTemplate.php

Documentation is available at Ethna_Plugin_Handle_AddTemplate.php

  1. <?php
  2. // vim: foldmethod=marker
  3. /**
  4.  *  Ethna_Plugin_Handle_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_BASE '/class/Plugin/Handle/Ethna_Plugin_Handle_AddAction.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(array('basedir=''skelfile='));
  30.         if (Ethna::isError($r)) {
  31.             return $r;
  32.         }
  33.         list($opt_list$arg_list$r;
  34.  
  35.         // template
  36.         $template array_shift($arg_list);
  37.         if ($template == null{
  38.             return Ethna::raiseError('template name isn\'t set.''usage');
  39.         }
  40.         $r =Ethna_Controller::checkViewName($template)// XXX: use checkViewName().
  41.         if (Ethna::isError($r)) {
  42.             return $r;
  43.         }
  44.  
  45.         // add template
  46.         $ret =$this->_perform('Template'$template$opt_list);
  47.  
  48.         return $ret;
  49.     }
  50.  
  51.     /**
  52.      *  get handler's description
  53.      *
  54.      *  @access public
  55.      */
  56.     function getDescription()
  57.     {
  58.         return <<<EOS
  59. add new template to project:
  60.     {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [template]
  61.  
  62. EOS;
  63.     }
  64.  
  65.     /**
  66.      *  @access public
  67.      */
  68.     function getUsage()
  69.     {
  70.         return <<<EOS
  71. ethna {$this->id} [-b|--basedir=dir] [-s|--skelfile=file] [template]
  72. EOS;
  73.     }
  74. }
  75. // }}}
  76. ?>

Documentation generated on Thu, 08 May 2008 00:15:12 +0900 by phpDocumentor 1.4.2