• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JControllerForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JControllerForm的典型用法代码示例。如果您正苦于以下问题:PHP JControllerForm类的具体用法?PHP JControllerForm怎么用?PHP JControllerForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: save

 /**
  * Save the configuration
  *
  * @return void
  * @since 1.0
  */
 function save()
 {
     $jform = JRequest::getVar('jform', array(), 'post', 'array');
     $iid = $jform['series_id'];
     $aid = $jform['automailing_id'];
     $msg = false;
     if (isset($jform['time_start']) && empty($jform['time_start'])) {
         $err = true;
         $msg = JText::_("COM_NEWSLETTER_START_TIME_IS_EMPTY");
     }
     //		if (isset($jform['time_offset']) && empty($jform['time_offset'])) {
     //			$err = true;
     //			$msg = JText::_("COM_NEWSLETTER_TIME_OFFSET_IS_EMPTY");
     //		}
     if (empty($err) && parent::save()) {
         // Set the redirect based on the task.
         switch ($this->getTask()) {
             case 'save':
                 $this->setRedirect(JRoute::_('index.php?option=com_newsletter&view=close&tmpl=component', false));
                 break;
         }
         return true;
     }
     $this->setRedirect(JRoute::_('index.php?option=com_newsletter&tmpl=component&view=' . $this->view_item . $this->getRedirectToItemAppend($iid, 'series_id') . '&automailing_id=' . $aid, false), $msg);
     return false;
 }
开发者ID:Rikisha,项目名称:proj,代码行数:32,代码来源:automailingitem.php


示例2:

 /**
  * constructor (registers additional tasks to methods)
  * @return void
  */
 function __construct()
 {
     parent::__construct();
     // Set reference to parameters
     $this->params = JComponentHelper::getParams('com_chessvn');
     //$dummy = $this->params->get('parm_text');
 }
开发者ID:khangcodt,项目名称:nvssehcweb,代码行数:11,代码来源:gameoption.php


示例3: save

 public function save($key = NULL, $urlVar = NULL)
 {
     if (!parent::save($key = NULL, $urlVar = NULL)) {
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_SAVE_FAILED', JText::_('COM_HTRAININGLOGS_PORTLET_EXISTS')));
         $this->setMessage($this->getError(), 'error');
     }
 }
开发者ID:hogeh,项目名称:htraininglogs2,代码行数:7,代码来源:downtime.php


示例4: cancel

 /**
  * Method to cancel an edit.
  *
  * @param     string     $key    The name of the primary key of the URL variable.
  *
  * @return    boolean            True if access level checks pass, false otherwise.
  */
 public function cancel($key = 'id')
 {
     $result = parent::cancel($key);
     // Redirect to the return page.
     $this->setRedirect($this->getReturnPage());
     return $result;
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:14,代码来源:form.php


示例5: DisplayView

 function DisplayView()
 {
     $submenu = JRequest::getVar('view');
     // Add submenu
     VideotranslationHelper::addSubmenu($submenu);
     parent::display();
 }
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:7,代码来源:pairslanguage.php


示例6: display

 /**
  * Proxy for getModel.
  */
 function display($cachable = false, $urlparams = array())
 {
     $task = $_POST['task'];
     if ($task == 'linksform.add' or $task == 'add' or $task == 'linksform.edit' or $task == 'edit') {
         $this->setRedirect('index.php?option=com_youtubegallery&view=settings&layout=edit');
         return true;
     }
     JRequest::setVar('view', 'settings');
     JRequest::setVar('layout', 'edit');
     switch (JRequest::getVar('task')) {
         case 'apply':
             $this->save();
             break;
         case 'settings.apply':
             $this->save();
             break;
         case 'save':
             $this->save();
             break;
         case 'settings.save':
             $this->save();
             break;
         case 'cancel':
             $this->cancel();
             break;
         case 'settings.cancel':
             $this->cancel();
             break;
         default:
             parent::display();
             break;
     }
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:36,代码来源:settings.php


示例7: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->_app = JFactory::getApplication();
     $this->_input = $this->_app->input;
     $this->_config = JSNConfigHelper::get();
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:7,代码来源:selectimages.php


示例8: array

 function __construct($config = array())
 {
     parent::__construct($config);
     // Need to set list view to plural format in legacy/controllers/form/constructor with array('/is$/i', "ises")
     // Or change like here
     $this->view_list = $this->view_item . "es";
 }
开发者ID:prox91,项目名称:joomla-dev,代码行数:7,代码来源:precis.php


示例9: edit

 /**
  * Edit document.
  */
 public function edit($key = null, $urlVar = null)
 {
     if (JFactory::getApplication()->isSite()) {
         JRequest::setVar('id', $this->getModel()->searchIdByPath(JoomDOCRequest::getPath()), 'post');
     }
     parent::edit();
 }
开发者ID:abdullah929,项目名称:bulletin,代码行数:10,代码来源:controllerform.php


示例10: save

 public function save($key = null, $urlVar = null)
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $model = $this->getModel('form');
     $preconfig = $app->input->post->get('config', array(), 'array');
     $task = $this->getTask();
     $config = $model->store($preconfig);
     $id = $config['pk'];
     if ($config['validate'] == 'retry') {
         parent::display();
         return true;
     }
     if ($id) {
         if ($config['stage'] > -1) {
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
             if ($config['stage'] > 0) {
                 $link .= '&stage=' . $config['stage'];
             }
             $this->setRedirect(htmlspecialchars_decode($link));
             return;
         }
         if ($config['message_style']) {
             if (isset($config['message'])) {
                 $msg = $config['doTranslation'] ? JText::_('COM_CCK_' . str_replace(' ', '_', trim($config['message']))) : $config['message'];
             } else {
                 $msg = JText::_('COM_CCK_SUCCESSFULLY_SAVED');
             }
             $msgType = $config['message_style'];
         } else {
             $msg = '';
             $msgType = '';
         }
     } else {
         $msg = JText::_('JERROR_AN_ERROR_HAS_OCCURRED');
         $msgType = 'error';
     }
     switch ($task) {
         case 'apply':
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . '&id=' . $id . $this->_getRedirectQuery();
             break;
         case 'save2new':
             $link = 'index.php?option=' . CCK_COM . '&view=form&type=' . $preconfig['type'] . $this->_getRedirectQuery();
             break;
         case 'save2view':
             $location = JCckDatabase::loadResult('SELECT storage_location FROM #__cck_core WHERE id = ' . (int) $id);
             $sef = 0;
             $itemId2 = 0;
             if ($location) {
                 require_once JPATH_SITE . '/plugins/cck_storage_location/' . $location . '/' . $location . '.php';
                 $link = JCck::callFunc_Array('plgCCK_Storage_Location' . $location, 'getRoute', array($config['pk'], $sef, $itemId2, array('type' => $config['type'])));
                 $link = str_replace('/administrator/', '/', $link);
                 break;
             }
         default:
             $link = $this->_getRedirectQuery(true);
             break;
     }
     $this->setRedirect(htmlspecialchars_decode($link), $msg, $msgType);
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:60,代码来源:form.php


示例11: allowEdit

 /**
  * Method override to check if you can edit an existing record.
  *
  * @param     array      $data    An array of input data.
  * @param     string     $key     The name of the key for the primary key.
  *
  * @return    boolean
  */
 protected function allowEdit($data = array(), $key = 'id')
 {
     $user = JFactory::getUser();
     $uid = $user->get('id');
     $id = (int) isset($data[$key]) ? $data[$key] : 0;
     $owner = (int) isset($data['created_by']) ? $data['created_by'] : 0;
     // Check general edit permission first.
     if ($user->authorise('core.edit', 'com_pfrepo.directory.' . $id)) {
         return true;
     }
     // Fallback on edit.own.
     if ($user->authorise('core.edit.own', 'com_pfrepo.directory.' . $id)) {
         // Now test the owner is the user.
         if (!$owner && $id) {
             $record = $this->getModel()->getItem($id);
             if (empty($record)) {
                 return false;
             }
             $owner = $record->created_by;
         }
         if ($owner == $uid) {
             return true;
         }
     }
     // Fall back to the component permissions.
     return parent::allowEdit($data, $key);
 }
开发者ID:gagnonjeanfrancois,项目名称:Projectfork,代码行数:35,代码来源:directory.php


示例12: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     if (JDEBUG) {
         JLog::addLogger(array('text_file' => 'com_usernotes.log.php'), JLog::ALL, array('com_usernotes'));
     }
 }
开发者ID:ron4mac,项目名称:joomla_com_usernotes,代码行数:7,代码来源:edit.php


示例13:

 function __construct()
 {
     parent::__construct();
     $this->registerTask('themeinstall', 'themeinstall');
     $this->registerTask('bgimagesmall', 'bgimagesmall');
     $this->registerTask('bgimagemedium', 'bgimagemedium');
 }
开发者ID:optimosolution,项目名称:marhk,代码行数:7,代码来源:phocagalleryt.php


示例14: add

 public function add()
 {
     JRequest::setVar('view', 'template');
     JRequest::setVar('layout', 'add');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
开发者ID:jehanryan,项目名称:Flotech,代码行数:7,代码来源:template.php


示例15: allowEdit

 /**
  * Method override to check if you can edit an existing record.
  *
  * @param   array   $data  An array of input data.
  * @param   string  $key   The name of the key for the primary key.
  *
  * @return  boolean
  *
  * @since   1.6
  */
 protected function allowEdit($data = array(), $key = 'id')
 {
     $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $canDo = ZhYandexMapHelper::getMarkerActions($recordId);
     $canEdit = $canDo->get('core.edit');
     $isEnabledEditOwn = $canDo->get('core.edit.own');
     if ($canEdit || $canEditOwn) {
     }
     // Check general edit permission first.
     if ($canEdit) {
         return true;
     }
     // Fallback on edit.own.
     // First test if the permission is available.
     if ($isEnabledEditOwn) {
         // Now test the owner is the user.
         $ownerId = (int) isset($data['createdbyuser']) ? $data['createdbyuser'] : 0;
         if (empty($ownerId) && $recordId) {
             // Need to do a lookup from the model.
             $record = $this->getModel()->getItem($recordId);
             if (empty($record)) {
                 return false;
             }
             $ownerId = $record->createdbyuser;
         }
         // If the owner matches 'me' then do the test.
         if ($ownerId == $userId) {
             return true;
         }
     }
     // Since there is no asset tracking, revert to the component permissions.
     return parent::allowEdit($data, $key);
 }
开发者ID:pupsikus,项目名称:bs.test,代码行数:45,代码来源:mapmarker.php


示例16: getModel

 /**
  * Method to get a model object, loading it if required.
  *
  * @param   string  $name    The model name. Optional.
  * @param   string  $prefix  The class prefix. Optional.
  * @param   array   $config  Configuration array for model. Optional.
  *
  * @return  object  The model.
  *
  * @since   11.1
  */
 public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
 {
     if (empty($name)) {
         $name = $this->context;
     }
     return parent::getModel($name, $prefix, array('ignore_request' => false));
 }
开发者ID:rsam,项目名称:com_tsj,代码行数:18,代码来源:electros.php


示例17: execute

 /**
  * Execute.
  *
  * @param   string  $task  An optional associative array of configuration settings.
  *
  * @return void
  *
  * @since    1.7.0
  */
 public function execute($task)
 {
     if ($task != 'run') {
         $task = 'browse';
     }
     parent::execute($task);
 }
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:16,代码来源:geoupdate.php


示例18: __construct

 /**
  * Construct the controller 
  * 
  * @copyright 
  * @author		RolandD 
  * @todo 
  * @see 
  * @access 		public
  * @param 
  * @return 
  * @since 		3.0
  */
 public function __construct()
 {
     parent::__construct();
     // Register some task
     $this->registerTask('sortcategories', 'options');
     $this->registerTask('icecatsettings', 'options');
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:19,代码来源:maintenance.raw.php


示例19: allowEdit

 /**
  * Method override to check if you can edit an existing record.
  *
  * @param   array   $data  An array of input data.
  * @param   string  $key   The name of the key for the primary key.
  *
  * @return  boolean
  *
  * @since    1.7.0
  */
 protected function allowEdit($data = [], $key = 'id')
 {
     // Initialise variables.
     $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
     $user = JFactory::getUser();
     $userId = $user->get('id');
     // Check general edit permission first.
     if ($user->authorise('core.edit')) {
         return true;
     }
     // Fallback on edit.own.
     // First test if the permission is available.
     if ($user->authorise('core.edit.own')) {
         // Now test the owner is the user.
         $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
         if (empty($ownerId) && $recordId) {
             // Need to do a lookup from the model.
             $record = $this->getModel()->getItem($recordId);
             if (empty($record)) {
                 return false;
             }
             $ownerId = $record->created_by;
         }
         // If the owner matches 'me' then do the test.
         if ($ownerId == $userId) {
             return true;
         }
     }
     // Since there is no asset tracking, revert to the component permissions.
     return parent::allowEdit($data, $key);
 }
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:41,代码来源:familyunit.php


示例20: edit

 public function edit($key = null, $urlVar = null)
 {
     JRequest::setVar('view', 'feed');
     JRequest::setVar('layout', 'feed');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
开发者ID:ingedgarcruz,项目名称:Ninja-RSS-Syndicator,代码行数:7,代码来源:feed.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JControllerLegacy类代码示例发布时间:2022-05-23
下一篇:
PHP JControllerAdmin类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap