当前位置: 首页>>代码示例>>PHP>>正文


PHP FormUtil::newForm方法代码示例

本文整理汇总了PHP中FormUtil::newForm方法的典型用法代码示例。如果您正苦于以下问题:PHP FormUtil::newForm方法的具体用法?PHP FormUtil::newForm怎么用?PHP FormUtil::newForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormUtil的用法示例。


在下文中一共展示了FormUtil::newForm方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: edit

 /**
  * This method provides a generic handling of all edit requests.
  *
  * @param string  $ot           Treated object type.
  * @param string  $tpl          Name of alternative template (for alternative display options, feeds and xml output)
  * @param boolean $raw          Optional way to display a template instead of fetching it (needed for standalone output)
  *
  * @return mixed Output.
  */
 public function edit()
 {
     $id = $this->request->query->filter('id', 0);
     if ($id > 0) {
         $url = ModUtil::url($this->name, 'user', 'view');
         return System::redirect($url);
     }
     $controllerHelper = new Reviews_Util_Controller($this->serviceManager);
     // parameter specifying which type of objects we are treating
     $objectType = $this->request->query->filter('ot', 'review', FILTER_SANITIZE_STRING);
     $utilArgs = array('controller' => 'user', 'action' => 'edit');
     if (!in_array($objectType, $controllerHelper->getObjectTypes('controllerAction', $utilArgs))) {
         $objectType = $controllerHelper->getDefaultObjectType('controllerAction', $utilArgs);
     }
     $this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . ':' . ucwords($objectType) . ':', '::', ACCESS_EDIT), LogUtil::getErrorMsgPermission());
     // create new Form reference
     $view = FormUtil::newForm($this->name, $this);
     // build form handler class name
     $handlerClass = $this->name . '_Form_Handler_User_' . ucfirst($objectType) . '_Edit';
     // determine the output template
     $viewHelper = new Reviews_Util_View($this->serviceManager);
     $template = $viewHelper->getViewTemplate($this->view, 'user', $objectType, 'edit', array());
     // execute form using supplied template and page event handler
     return $view->execute($template, new $handlerClass());
 }
开发者ID:rmaiwald,项目名称:Reviews,代码行数:34,代码来源:User.php

示例2: configure

 /**
  * Configuration screen.
  *
  * @return string Plugin configuration output.
  */
 public function configure()
 {
     // Create form
     $form = FormUtil::newForm($this->pluginName, $this);
     $form->setCompileId($this->pluginName);
     return $form->execute('configure.tpl', new Scribite_FormHandler_ModifyEditor());
 }
开发者ID:pheski,项目名称:Scribite,代码行数:12,代码来源:Controller.php

示例3: modifyconfig

 public function modifyconfig()
 {
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('Scribite::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());
     // Create form
     $form = FormUtil::newForm('Scribite', $this);
     return $form->execute('admin/modifyconfig.tpl', new Scribite_FormHandler_ModifyConfig());
 }
开发者ID:pheski,项目名称:Scribite,代码行数:7,代码来源:Admin.php

示例4: main

 /**
  * Main Admin function
  */
 public function main()
 {
     if (!SecurityUtil::checkPermission('BBSmile::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError(System::getHomepageUrl());
     }
     $form = FormUtil::newForm('BBSmile', $this);
     return $form->execute('admin/modifyconfig.tpl', new BBSmile_Form_Handler_Admin_ModifyConfig());
 }
开发者ID:rmaiwald,项目名称:BBSmile,代码行数:11,代码来源:Admin.php

示例5: edit

 /**
  * Create or edit record.
  *
  * @return string|boolean Output.
  */
 public function edit()
 {
     if (!SecurityUtil::checkPermission('ExampleDoctrine::', '::', ACCESS_ADD)) {
         return LogUtil::registerPermissionError(ModUtil::url('ExampleDoctrine', 'user', 'main'));
     }
     $form = FormUtil::newForm('ExampleDoctrine', $this);
     return $form->execute('exampledoctrine_user_edit.tpl', new ExampleDoctrine_Handler_Edit());
 }
开发者ID:projectesIF,项目名称:Sirius,代码行数:13,代码来源:User.php

示例6: testconfig

    /**
     * This function displays a form to sent a test mail
     * @return string HTML string
     */
    public function testconfig()
    {
        $this->throwForbiddenUnless(SecurityUtil::checkPermission('Mailer::', '::', ACCESS_ADMIN));

        $form = FormUtil::newForm('Mailer', $this);

        return $form->execute('mailer_admin_testconfig.tpl', new Mailer_Form_Handler_TestConfig());
    }
开发者ID:projectesIF,项目名称:Sirius,代码行数:12,代码来源:Admin.php

示例7: getVideos

 /**
  * This method takes care of the application configuration.
  *
  * @return string Output
  */
 public function getVideos()
 {
     // DEBUG: permission check aspect starts
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('MUVideo::', '::', ACCESS_EDIT));
     // DEBUG: permission check aspect ends
     // parameter specifying which type of objects we are treating
     $objectType = isset($args['ot']) && !empty($args['ot']) ? $args['ot'] : $this->request->getGet()->filter('ot', 'collection', FILTER_SANITIZE_STRING);
     $utilArgs = array('controller' => 'user', 'action' => 'getVideos');
     if (!in_array($objectType, MUVideo_Util_Controller::getObjectTypes('controllerAction', $utilArgs))) {
         $objectType = MUVideo_Util_Controller::getDefaultObjectType('controllerAction', $utilArgs);
     }
     // create new Form reference
     $view = FormUtil::newForm($this->name, $this);
     // build form handler class name
     $handlerClass = 'MUVideo_Form_Handler_' . ucfirst($objectType) . '_GetVideos';
     // determine the output template
     $viewHelper = new MUVideo_Util_View($this->serviceManager);
     $template = $viewHelper->getViewTemplate($this->view, $objectType, 'getVideos', array());
     // execute form using supplied template and page event handler
     return $view->execute($template, new $handlerClass());
 }
开发者ID:robbrandt,项目名称:MUVideo,代码行数:26,代码来源:Collection.php

示例8: modifyconfig

 /**
  * modify the configuration
  *
  * @author       J?rg Napp, Frank Schummertz
  * @return       output       The modify config page.
  */
 public function modifyconfig()
 {
     if (!SecurityUtil::checkPermission('Avatar::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError();
     }
     // Create output object
     $avatarform = FormUtil::newForm('Avatar', $this);
     // Return the output that has been generated by this function
     return $avatarform->execute('Avatar_admin_modifyconfig.htm', new Avatar_Form_Handler_Admin_ModifyConfig());
 }
开发者ID:robbrandt,项目名称:Avatar,代码行数:16,代码来源:Admin.php

示例9: modify

 /**
  * Modify a comment
  *
  * This is a standard function that is called whenever an comment owner
  * wishes to modify a comment
  *
  * @param  tid the id of the comment to be modified
  * @return string the modification page
  */
 public function modify($args)
 {
     // get our input
     $id = isset($args['id']) ? $args['id'] : FormUtil::getPassedValue('id', null, 'GETPOST');
     // Security check
     $securityCheck = ModUtil::apiFunc('EZComments', 'user', 'checkPermission', array('module' => '', 'objectid' => '', 'commentid' => $id, 'level' => ACCESS_EDIT));
     if (!$securityCheck) {
         $redirect = base64_decode(FormUtil::getPassedValue('redirect'));
         if (!isset($redirect)) {
             $redirect = System::getHomepageUrl();
         }
         return LogUtil::registerPermissionError($redirect);
     }
     // Create Form output object
     $render = FormUtil::newForm('EZComments', $this);
     // Return the output that has been generated by this function
     return $render->execute("ezcomments_user_modify.tpl", new EZComments_Form_Handler_User_Modify());
 }
开发者ID:rmaiwald,项目名称:EZComments,代码行数:27,代码来源:User.php

示例10: edit

 /**
  * This method provides a generic handling of all edit requests.
  *
  * @param string  $ot           Treated object type.
  * @param string  $tpl          Name of alternative template (for alternative display options, feeds and xml output)
  * @param boolean $raw          Optional way to display a template instead of fetching it (needed for standalone output)
  * @return mixed Output.
  */
 public function edit($args)
 {
     // DEBUG: permission check aspect starts
     $this->throwForbiddenUnless(SecurityUtil::checkPermission('MUBoard::', '::', ACCESS_EDIT));
     // DEBUG: permission check aspect ends
     // parameter specifying which type of objects we are treating
     $objectType = isset($args['ot']) && !empty($args['ot']) ? $args['ot'] : $this->request->getGet()->filter('ot', 'category', FILTER_SANITIZE_STRING);
     $utilArgs = array('controller' => 'user', 'action' => 'edit');
     if (!in_array($objectType, MUBoard_Util_Controller::getObjectTypes('controllerAction', $utilArgs))) {
         $objectType = MUBoard_Util_Controller::getDefaultObjectType('controllerAction', $utilArgs);
     }
     // create new Form reference
     $view = FormUtil::newForm($this->name, $this);
     // build form handler class name
     $handlerClass = 'MUBoard_Form_Handler_User_' . ucfirst($objectType) . '_Edit';
     // execute form using supplied template and page event handler
     return $view->execute('user/' . $objectType . '/edit.tpl', new $handlerClass());
 }
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:26,代码来源:User.php

示例11: config

 /**
  * This method takes care of the application configuration.
  *
  * @return string Output
  */
 public function config()
 {
     $this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . '::', '::', ACCESS_ADMIN));
     // Create new Form reference
     $view = FormUtil::newForm($this->name, $this);
     // Execute form using supplied template and page event handler
     return $view->execute('admin/config.tpl', new MUBoard_Form_Handler_Admin_Config());
 }
开发者ID:rmaiwald,项目名称:MUBoard,代码行数:13,代码来源:Admin.php

示例12: deletedpages

 /**
  * Restore deleted pages
  * @param <type> $args
  * @return <type>
  */
 public function deletedpages($args)
 {
     $view = FormUtil::newForm('Content', $this);
     return $view->execute('admin/deletedpages.tpl', new Content_Form_Handler_Admin_DeletedPages($args));
 }
开发者ID:robbrandt,项目名称:Content,代码行数:10,代码来源:Admin.php

示例13: modifyconfig

 /**
  * Modify configuration
  *
  * This is a standard function to modify the configuration parameters of the
  * module
  *
  * @return string The configuration page
  */
 public function modifyconfig()
 {
     // Security check
     if (!SecurityUtil::checkPermission('EZComments::', '::', ACCESS_ADMIN)) {
         return LogUtil::registerPermissionError();
     }
     // Create Form output object
     $render = FormUtil::newForm('EZComments', $this);
     // Return the output that has been generated by this function
     return $render->execute('ezcomments_admin_modifyconfig.tpl', new EZComments_Form_Handler_Admin_ModifyConfig());
 }
开发者ID:rmaiwald,项目名称:EZComments,代码行数:19,代码来源:Admin.php

示例14: edit

 /**
  * This method provides a handling of edit requests.
  *
  * @param string  $tpl          Name of alternative template (to be used instead of the default template).
  * @param boolean $raw          Optional way to display a template instead of fetching it (required for standalone output).
  *
  * @return mixed Output.
  */
 public function edit()
 {
     $legacyControllerType = $this->request->query->filter('lct', 'user', FILTER_SANITIZE_STRING);
     System::queryStringSetVar('type', $legacyControllerType);
     $this->request->query->set('type', $legacyControllerType);
     $controllerHelper = new MUVideo_Util_Controller($this->serviceManager);
     // parameter specifying which type of objects we are treating
     $objectType = 'movie';
     $utilArgs = array('controller' => 'movie', 'action' => 'edit');
     $permLevel = $legacyControllerType == 'admin' ? ACCESS_ADMIN : ACCESS_EDIT;
     $this->throwForbiddenUnless(SecurityUtil::checkPermission($this->name . ':' . ucfirst($objectType) . ':', '::', $permLevel), LogUtil::getErrorMsgPermission());
     // create new Form reference
     $view = FormUtil::newForm($this->name, $this);
     // build form handler class name
     $handlerClass = $this->name . '_Form_Handler_Movie_Edit';
     // determine the output template
     $viewHelper = new MUVideo_Util_View($this->serviceManager);
     $template = $viewHelper->getViewTemplate($this->view, $objectType, 'edit', array());
     // execute form using supplied template and page event handler
     return $view->execute($template, new $handlerClass());
 }
开发者ID:robbrandt,项目名称:MUVideo,代码行数:29,代码来源:Movie.php


注:本文中的FormUtil::newForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。