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


PHP JControllerForm::add方法代码示例

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


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

示例1: add

 /**
  * Method to add a new record.
  *
  * @return	boolean	True if the article can be added, false if not.
  * @since	1.6
  */
 public function add()
 {
     if (!parent::add()) {
         // Redirect to the return page.
         $this->setRedirect($this->getReturnPage());
     }
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:13,代码来源:article.php

示例2: add

 public function add()
 {
     $app = JFactory::getApplication();
     $context = 'com_jbusinessdirectory.edit.billingdetails';
     $result = parent::add();
     if ($result) {
         $this->setRedirect(JRoute::_('index.php?option=com_jbusinessdirectory&view=billingdetails' . $this->getRedirectToItemAppend(), false));
     }
     return $result;
 }
开发者ID:benji1979,项目名称:teszt1,代码行数:10,代码来源:billingdetails.php

示例3: add

 /**
  * Method to add a new record.
  *
  * @return  mixed  True if the record can be added, a error object if not.
  *
  * @since   1.6
  */
 public function add()
 {
     if (!parent::add()) {
         // Set the internal error and also the redirect error.
         $this->setError(JText::_('COM_SIBDIET_ERROR_YOU_HAVE_ACTIVE_REQUEST'));
         $this->setMessage($this->getError(), 'notice');
         // Redirect to the return page.
         $this->setRedirect($this->getReturnPage());
     }
 }
开发者ID:smhnaji,项目名称:sdnet,代码行数:17,代码来源:request.php

示例4: add

 public function add()
 {
     $app = JFactory::getApplication();
     // Parent Method
     $result = parent::add();
     if (JError::isError($result)) {
         return $result;
     }
     // Additional Vars
     $app->setUserState(CCK_COM . '.edit.template.mode', $app->input->getString('mode', ''));
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:11,代码来源:template.php

示例5: add

 public function add()
 {
     $app = JFactory::getApplication();
     $context = 'com_jhotelreservation.edit.extraoption';
     $result = parent::add();
     if ($result) {
         $sourceId = JRequest::getInt('sourceId');
         $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=extraoption&sourceId=' . $sourceId . $this->getRedirectToItemAppend(), false));
     }
     return $result;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:11,代码来源:extraoption.php

示例6: add

 /**
  * Method to add a new menu item.
  *
  * @return  mixed  True if the record can be added, a JError object if not.
  *
  * @since   1.6
  */
 public function add()
 {
     $app = JFactory::getApplication();
     $context = 'com_menus.edit.item';
     $result = parent::add();
     if ($result) {
         $app->setUserState($context . '.type', null);
         $app->setUserState($context . '.link', null);
         $menuType = $app->getUserStateFromRequest($this->context . '.filter.menutype', 'menutype', 'mainmenu', 'cmd');
         $this->setRedirect(JRoute::_('index.php?option=com_menus&view=item&menutype=' . $menuType . $this->getRedirectToItemAppend(), false));
     }
     return $result;
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:20,代码来源:item.php

示例7: add

 public function add()
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     $context = 'com_jhotelreservation.edit.room';
     $result = parent::add();
     if ($result) {
         $hotelId = $app->getUserStateFromRequest('filter.hotel_id', 'hotel_id', '1', 'cmd');
         //dmp("H: ".$hotelId);
         $this->setRedirect(JRoute::_('index.php?option=com_jhotelreservation&view=room&hotel_id=' . $hotelId . $this->getRedirectToItemAppend(), false));
     }
     return $result;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:13,代码来源:room.php

示例8: add

 public function add()
 {
     $db = JFactory::getDbo();
     $query = "SELECT id FROM #__categories WHERE `extension`='com_smfaq' AND `published`!='-2'";
     $db->setQuery($query);
     $categoryCheck = $db->loadResult();
     if (!$categoryCheck) {
         $this->setError(JText::_('COM_SMFAQ_NO_CATEGORY_ERROR'), 'error');
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list));
         return;
     }
     parent::add();
 }
开发者ID:romuland,项目名称:khparts,代码行数:14,代码来源:smfaq.php

示例9: add

 /**
  * Override parent add method.
  */
 public function add()
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     // Get the result of the parent method. If an error, just return it.
     $result = parent::add();
     if (JError::isError($result)) {
         return $result;
     }
     // Look for the Extension ID.
     $extensionId = JRequest::getInt('eid');
     if (empty($extensionId)) {
         $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false));
         return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION'));
     }
     $app->setUserState('com_modules.add.module.extension_id', $extensionId);
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:20,代码来源:module.php

示例10: add

 public function add()
 {
     $app = JFactory::getApplication();
     // Parent Method
     $result = parent::add();
     if (JError::isError($result)) {
         return $result;
     }
     // Additional Vars
     $app->setUserState('com_cck.add.box.validation', $app->input->getInt('validation', 0));
     $app->setUserState('com_cck.add.box.file', $app->input->getString('file', ''));
     $app->setUserState('com_cck.add.box.function', $app->input->getString('function', ''));
     $app->setUserState('com_cck.add.box.bx.id', $app->input->get('id', ''));
     $app->setUserState('com_cck.add.box.bx.title', $app->input->getString('title', ''));
     $app->setUserState('com_cck.add.box.bx.name', $app->input->get('name', ''));
     $app->setUserState('com_cck.add.box.bx.type', $app->input->getString('type', ''));
     $app->setUserState('com_cck.add.box.bx.params', $app->input->getString('params', ''));
 }
开发者ID:codigoaberto,项目名称:SEBLOD,代码行数:18,代码来源:box.php

示例11: add

 /**
  * Method to add widget to load form.
  *
  * @return  void
  *
  * @since   3.0
  */
 public function add()
 {
     $app = JFactory::getApplication();
     $result = parent::add();
     if ($result instanceof Exception) {
         return $result;
     }
     $type = $app->input->get('wgtype', 0, 'string');
     $title = $app->input->get('title', 0, 'string');
     if (empty($type)) {
         $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false));
         return JError::raiseWarning(500, JText::_('COM_BT_SOCIALCONNECT_ERROR_INVALID_EXTENSION'));
     }
     $app->setUserState('com_bt_socialconnect.add.widget.wgtype', $type);
     $app->setUserState('com_bt_socialconnect.add.widget.title', $title);
     $app->setUserState('com_bt_socialconnect.add.widget.params', null);
     $params = $app->input->get('params', array(), 'array');
     $app->setUserState('com_bt_socialconnect.add.widget.params', $params);
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:26,代码来源:widget.php

示例12: add

 /**
  * Override parent add method.
  *
  * @return  mixed  True if the record can be added, a JError object if not.
  *
  * @since   1.6
  */
 public function add()
 {
     $app = JFactory::getApplication();
     // Get the result of the parent method. If an error, just return it.
     $result = parent::add();
     if ($result instanceof Exception) {
         return $result;
     }
     // Look for the Extension ID.
     $extensionId = $app->input->get('eid', 0, 'int');
     if (empty($extensionId)) {
         $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_item . '&layout=edit', false));
         return JError::raiseWarning(500, JText::_('COM_MODULES_ERROR_INVALID_EXTENSION'));
     }
     $app->setUserState('com_modules.add.module.extension_id', $extensionId);
     $app->setUserState('com_modules.add.module.params', null);
     // Parameters could be coming in for a new item, so let's set them.
     $params = $app->input->get('params', array(), 'array');
     $app->setUserState('com_modules.add.module.params', $params);
 }
开发者ID:shoffmann52,项目名称:install-from-web-server,代码行数:27,代码来源:module.php

示例13: add

 /**
  * Override parent add method.
  *
  * @throws Exception
  * @return  mixed  True if the record can be added, a JError object if not.
  *
  * @since   1.6
  */
 public function add()
 {
     // Initialise variables.
     $app = JFactory::getApplication();
     // Get the result of the parent method. If an error, just return it.
     $result = parent::add();
     if ($result instanceof Exception) {
         return $result;
     }
     // Look for the Extension ID.
     $extensionId = $app->input->get('eid', 0, 'int');
     if (empty($extensionId)) {
         $this->setRedirect(JRoute::_(sprintf('index.php?option=%s&view=modules', RokSprocket_Helper::getRedirectionOption()), false));
         throw new Exception(JText::_('COM_MODULES_ERROR_INVALID_EXTENSION', 500));
     }
     $app->setUserState('com_modules.add.module.extension_id', $extensionId);
     $app->setUserState('com_modules.add.module.params', null);
     // Parameters could be coming in for a new item, so let's set them.
     $params = $app->input->get('params', array(), 'array');
     $app->setUserState('com_modules.add.module.params', $params);
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:29,代码来源:module.php

示例14: execute

 public function execute($task = null)
 {
     $app = JFactory::getApplication();
     $modelName = $app->input->get('model', 'Member');
     // Required objects
     $input = JFactory::getApplication()->input;
     // Get the form data
     $this->formData = new JRegistry($input->get('jform', '', 'array'));
     //Get model class
     $this->model = $this->getModel($modelName);
     if ($task == 'deleteAvailibility') {
         $member_daytime_id = $input->get('member_daytime_id');
         $this->deleteAvailibility($member_daytime_id);
     } else {
         if ($task == 'delete') {
             $member_id = $input->get('member_id');
             $this->delete($member_id);
         } else {
             if ($task == 'add') {
                 parent::add();
             } else {
                 if ($task == 'edit') {
                     parent::edit();
                 } else {
                     if ($task == 'apply') {
                         if ($this->formData['member_id'] == null) {
                             $result = EstivoleHelpersUser::registerUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], 'est1val3', null, $this->formData);
                         } else {
                             $result = EstivoleHelpersUser::updateUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], $this->formData);
                         }
                         if ($result->success) {
                             $app->enqueueMessage('Profil enregistré avec succès!');
                             $app->redirect('index.php?option=com_estivole&view=member&layout=edit&task=member.edit&controller=member&member_id=' . $result->member_id);
                         } else {
                             $app->enqueueMessage($result->message, 'error');
                             $app->redirect($_SERVER['HTTP_REFERER']);
                         }
                     } else {
                         if ($task == 'save') {
                             if ($this->formData['member_id'] == null) {
                                 $result = EstivoleHelpersUser::registerUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], 'est1val3', null, $this->formData);
                             } else {
                                 $result = EstivoleHelpersUser::updateUser($this->formData['profilestivole.firstname'] . ' ' . $this->formData['profilestivole.lastname'], $this->formData['username'], $this->formData['email'], $this->formData);
                             }
                             if ($result->success) {
                                 $app->enqueueMessage('Profil enregistré avec succès!');
                                 $app->redirect('index.php?option=com_estivole&view=members');
                             } else {
                                 $app->enqueueMessage($result->message, 'error');
                                 $app->redirect($_SERVER['HTTP_REFERER']);
                             }
                         } else {
                             if ($task == 'cancel') {
                                 parent::cancel();
                             } else {
                                 $this->display();
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:gorgozilla,项目名称:Estivole,代码行数:64,代码来源:member.php

示例15: add_test

 /**
  * Overwrite for method to add a new record for a test-recipient
  *
  * @since	1.0.1
  */
 public function add_test()
 {
     // set state for test-recipient…
     JFactory::getApplication()->setUserState('com_bwpostman.subscriber.new_test', '9');
     parent::add();
 }
开发者ID:RomanaBW,项目名称:BwPostman,代码行数:11,代码来源:subscriber.php


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