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

PHP jexit函数代码示例

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

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



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

示例1: featured

 /**
  * Method to toggle the featured setting of a list of articles.
  *
  * @return	void
  * @since	1.6
  */
 function featured()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $user = JFactory::getUser();
     $ids = JRequest::getVar('cid', array(), '', 'array');
     $values = array('featured' => 1, 'unfeatured' => 0);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($values, $task, 0, 'int');
     // Access checks.
     foreach ($ids as $i => $id) {
         if (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id)) {
             // Prune items that you can't change.
             unset($ids[$i]);
             JError::raiseNotice(403, JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
         }
     }
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Publish the items.
         if (!$model->featured($ids, $value)) {
             JError::raiseWarning(500, $model->getError());
         }
     }
     $this->setRedirect('index.php?option=com_content&view=articles');
 }
开发者ID:joomline,项目名称:Joomla2.5.999,代码行数:36,代码来源:articles.php


示例2: save

 /**
  * Logic to save
  */
 function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     // Get the model
     $model = $this->getModel('groups');
     // Save
     $result = $model->save();
     $cid = $model->getId();
     $tabposition = JRequest::getInt('tabposition', 0);
     $task = JRequest::getCmd('task');
     switch ($task) {
         case 'apply':
             $link = 'index.php?option=com_rsticketspro&controller=groups&task=edit&cid=' . $cid . '&tabposition=' . $tabposition;
             if ($result) {
                 $this->setRedirect($link, JText::_('RST_GROUP_SAVED_OK'));
             } else {
                 $this->setRedirect($link, JText::_('RST_GROUP_SAVED_ERROR'));
             }
             break;
         case 'save':
             $link = 'index.php?option=com_rsticketspro&view=groups';
             if ($result) {
                 $this->setRedirect($link, JText::_('RST_GROUP_SAVED_OK'));
             } else {
                 $this->setRedirect($link, JText::_('RST_GROUP_SAVED_ERROR'));
             }
             break;
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:33,代码来源:groups.php


示例3: getInstance

	/**
	 * Returns a session storage handler object, only creating it if it doesn't already exist.
	 *
	 * @param   name   $name     The session store to instantiate
	 * @param   array  $options  Array of options
	 *
	 * @return  JSessionStorage
	 *
	 * @since   11.1
	 */
	public static function getInstance($name = 'none', $options = array())
	{
		static $instances;

		if (!isset($instances))
		{
			$instances = array();
		}

		$name = strtolower(JFilterInput::getInstance()->clean($name, 'word'));

		if (empty($instances[$name]))
		{
			$class = 'JSessionStorage' . ucfirst($name);

			if (!class_exists($class))
			{
				$path = dirname(__FILE__) . '/storage/' . $name . '.php';

				if (file_exists($path))
				{
					require_once $path;
				}
				else
				{
					// No call to JError::raiseError here, as it tries to close the non-existing session
					jexit('Unable to load session storage class: ' . $name);
				}
			}

			$instances[$name] = new $class($options);
		}

		return $instances[$name];
	}
开发者ID:nikosdion,项目名称:Akeeba-Example,代码行数:45,代码来源:storage.php


示例4: featured

 /**
  * Method to toggle the featured setting of a list of memberss.
  *
  * @return    void
  *
  * @since    1.7.0
  */
 public function featured()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialise variables.
     $user = JFactory::getUser();
     $app = JFactory::getApplication();
     $ids = $app->input->get('id', [], 'array');
     $task = $this->getTask();
     $value = Joomla\Utilities\ArrayHelper::getValue($values, $task, 0, 'int');
     // Get the model.
     $model = $this->getModel();
     // Access checks.
     foreach ($ids as $i => $id) {
         if (!$user->authorise('core.edit.state')) {
             // Prune items that you can't change.
             unset($ids[$i]);
             $app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 'notice');
         }
     }
     if (empty($ids)) {
         $app->enqueueMessage(JText::_('COM_CHURCHDIRECTORY_NO_ITEM_SELECTED'), 'warning');
     } else {
         // Publish the items.
         if (!$model->featured($ids, $value)) {
             $app->enqueueMessage($model->getError(), 'warning');
         }
     }
     $this->setRedirect('index.php?option=com_churchdirectory&view=postions');
 }
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:37,代码来源:positions.php


示例5: save

 public function save($key = null, $urlVar = null)
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $data = $this->input->post->get('jform', array(), 'array');
     $itemId = Joomla\Utilities\ArrayHelper::getValue($data, "id");
     $redirectOptions = array("task" => $this->getTask(), "id" => $itemId);
     $model = $this->getModel();
     /** @var $model CrowdfundingModelComment */
     $form = $model->getForm($data, false);
     /** @var $form JForm */
     if (!$form) {
         throw new Exception(JText::_("COM_CROWDFUNDING_ERROR_FORM_CANNOT_BE_LOADED"), 500);
     }
     // Validate the form data
     $validData = $model->validate($form, $data);
     // Check for errors
     if ($validData === false) {
         $this->displayNotice($form->getErrors(), $redirectOptions);
         return;
     }
     try {
         $itemId = $model->save($validData);
         $redirectOptions["id"] = $itemId;
     } catch (Exception $e) {
         JLog::add($e->getMessage());
         throw new Exception(JText::_('COM_CROWDFUNDING_ERROR_SYSTEM'));
     }
     $this->displayMessage(JText::_('COM_CROWDFUNDING_COMMENT_SAVED'), $redirectOptions);
 }
开发者ID:bellodox,项目名称:CrowdFunding,代码行数:29,代码来源:comment.php


示例6: sendEmail

 function sendEmail()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     $post = JRequest::get('post');
     $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models');
     $model = $this->getModel('location');
     $location = $model->getData();
     $contact_name = $post['contact_name'];
     $contact_email = $post['contact_email'];
     $contact_message = $post['contact_message'];
     if ($contact_name == null || $contact_message == null) {
         echo JText::_('Please enter a name and message to send.');
         return false;
     } else {
         if (false) {
             return false;
         } else {
             JUtility::sendMail($contact_email, $contact_name, $location->email, 'Contact Message for: ' . $location->name, $contact_message, 0, null, null, null, $contact_email, $contact_name);
             echo JText::_('Message Sent');
             return true;
         }
     }
     return false;
 }
开发者ID:notWood,项目名称:webmapplus,代码行数:25,代码来源:controller.php


示例7: save

 public function save()
 {
     // check for request forgeries
     YRequest::checkToken() or jexit('Invalid Token');
     // init vars
     $post = YRequest::get('post');
     try {
         // bind post
         $this->application->bind($post, array('params'));
         // set params
         $params = $this->application->getParams()->remove('global.')->set('group', @$post['group'])->set('template', @$post['template'])->set('global.config.', @$post['params']['config'])->set('global.template.', @$post['params']['template']);
         if (isset($post['addons']) && is_array($post['addons'])) {
             foreach ($post['addons'] as $addon => $value) {
                 $params->set("global.{$addon}.", $value);
             }
         }
         $this->application->params = $params->toString();
         // save application
         YTable::getInstance('application')->save($this->application);
         // set redirect
         $msg = JText::_('Application Saved');
         $link = $this->link_base . '&changeapp=' . $this->application->id;
     } catch (YException $e) {
         // raise notice on exception
         JError::raiseNotice(0, JText::_('Error Saving Application') . ' (' . $e . ')');
         // set redirect
         $msg = null;
         $link = $this->baseurl . '&task=add';
     }
     $this->setRedirect($link, $msg);
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:31,代码来源:new.php


示例8: emailFriend

 function emailFriend()
 {
     JRequest::checkToken() or jexit('Invalid Token');
     require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'jobboard_member.php';
     $app = JFactory::getApplication();
     if (JobBoardHelper::verifyHumans()) {
         if (!JobBoardMemberHelper::matchHumanCode(JRequest::getString('human_ver', ''))) {
             $post = JArrayHelper::toObject(JRequest::get('post'));
             $post->errors = 1;
             if (isset($post->human_ver)) {
                 unset($post->human_ver);
             }
             $app->setUserState('com_jobboard.sfields', $post);
             $app->redirect(JRoute::_('index.php?option=com_jobboard&view=share&errors=1&job_id=' . $post->job_id . '&Itemid=' . JRequest::getInt('Itemid')), JText::_('COM_JOBBOARD_FORM_CAPTCHA_FAILMSG'), 'error');
             return;
         }
     }
     $message = new JObject();
     $message->job_id = JRequest::getVar('job_id', '', '', 'int');
     $catid = JRequest::getVar('catid', '', '', 'int');
     $message->job_title = JRequest::getVar('job_title', '', '', 'string');
     $message->job_city = JRequest::getVar('job_city', '', '', 'string');
     $message->personal_message = JRequest::getVar('personal_message', '', '', 'string');
     $uri =& JURI::getInstance();
     $message->link = $uri->getScheme() . '://' . $uri->getHost() . JRequest::getVar('job_path', '', '', 'string');
     $fields_valid = $this->validateFields();
     $message->sender_email = $fields_valid->sender_email;
     $message->sender_name = $fields_valid->sender_name;
     $message->rec_emails = $fields_valid->rec_emails;
     if ($fields_valid->errors === true) {
         $errmsg = $fields_valid->errmsg . '</ul>';
         $app->setUserState('sfields', $message);
         $link = JRoute::_('index.php?option=com_jobboard&view=share&errors=1&job_id=' . $message->job_id . '&Itemid=' . $itemid);
         $this->setRedirect($link, $errmsg, '');
         return;
     } else {
         if (stristr($message->rec_emails, ',') === TRUE) {
             $rec_emailarray = explode(',', $message->rec_emails);
             foreach ($rec_emailarray as $email_recipient) {
                 $this->sendEmail($message, trim($email_recipient));
             }
         } else {
             $this->sendEmail($message, trim($message->rec_emails));
         }
         $mesgModel =& $this->getModel('Message');
         $saved = $mesgModel->saveMessage($message);
         if ($saved) {
             $msg = '&nbsp;' . JText::_('SEND_MSG_SUCCESS');
             $link = JRoute::_('index.php?option=com_jobboard&view=job&id=' . $message->job_id, false);
             $this->setRedirect($link, $msg, '');
             return;
         } else {
             $msg = '&nbsp;' . JText::_('ERR_WAIT');
             $link = JRoute::_('index.php?option=com_jobboard&view=job&id=' . $message->job_id, false);
             $this->setRedirect($link, $msg, '');
             return;
         }
     }
     parent::display();
 }
开发者ID:Rayvid,项目名称:joomla-jobboard,代码行数:60,代码来源:job.php


示例9: help

 public function help()
 {
     $user = JFactory::getUser();
     $jinput = JFactory::getApplication()->input;
     // Check Token!
     $token = JSession::getFormToken();
     $call_token = $jinput->get('token', 0, 'ALNUM');
     if ($user->id != 0 && $token == $call_token) {
         $task = $this->getTask();
         switch ($task) {
             case 'getText':
                 try {
                     $idValue = $jinput->get('id', 0, 'INT');
                     if ($idValue) {
                         $result = $this->getHelpDocumentText($idValue);
                     } else {
                         $result = '';
                     }
                     echo $result;
                     // stop execution gracefully
                     jexit();
                 } catch (Exception $e) {
                     // stop execution gracefully
                     jexit();
                 }
                 break;
         }
     } else {
         // stop execution gracefully
         jexit();
     }
 }
开发者ID:namibia,项目名称:CBP-Joomla-3-Component,代码行数:32,代码来源:help.php


示例10: makemainurl

 public function makemainurl()
 {
     // Check for request forgeries
     JRequest::checkToken() or jexit('Invalid Token');
     // find and store edited item id
     $cid = JRequest::getVar('cid', array(0), 'default', 'array');
     // check invalid data
     if (!is_array($cid) || count($cid) != 1 || intval($cid[0]) == 0) {
         $redirect = array('c' => "duplicates", 'tmpl' => 'component', 'cid[]' => JRequest::getInt('mainurl_id'));
         $this->setRedirect($this->_getDefaultRedirect($redirect), JText16::_('COM_SH404SEF_SELECT_ONE_URL'), 'error');
         // send back response through default view
         $this->display();
     }
     // now make that url the main url
     // while also setting the previous
     // with this url current rank
     // get the model to do it, actually
     // Get/Create the model
     if ($model =& $this->getModel($this->_defaultModel, 'Sh404sefModel')) {
         // store initial context in model
         $model->setContext($this->_context);
         // call the delete method on our list
         $model->makeMainUrl(intval($cid[0]));
         // check errors and enqueue them for display if any
         $errors = $model->getErrors();
         if (!empty($errors)) {
             $this > enqueuemessages($errors, 'error');
         }
     }
     // send back response through default view
     $this->display();
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:32,代码来源:duplicates.php


示例11: geoupdate

 /**
  * Method to update members geoupdate location.
  *
  * @return    void
  *
  * @since    1.7.0
  */
 public function geoupdate()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $ids = $this->input->get('cid', [], 'array');
     // Get the model.
     /** @var  ChurchDirectoryModelGeoStatus $model */
     $model = $this->getModel();
     // Access checks.
     foreach ($ids as $i => $id) {
         $item = $model->getItem($id);
         if (!$user->authorise('core.edit.state', 'com_churchdirectory.category.' . (int) $item->catid)) {
             // Prune items that you can't change.
             unset($ids[$i]);
             $app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'), 'notice');
         }
     }
     if (empty($ids)) {
         $app->enqueueMessage(JText::_('COM_CHURCHDIRECTORY_NO_ITEM_SELECTED'), 'error');
     } else {
         // Publish the items.
         if (!$model->update($ids)) {
             $app->enqueueMessage($model->getError(), 'error');
         }
     }
     $this->setRedirect('index.php?option=com_churchdirectory&view=geostatus');
 }
开发者ID:Joomla-Bible-Study,项目名称:joomla_churchdirectory,代码行数:36,代码来源:geostatus.php


示例12: display

 /**
  * Display method
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return	void
  */
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     $showcaseID = JRequest::getVar('showcase_id');
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $objShowcaseTheme = JSNISFactory::getObj('classes.jsn_is_showcasetheme');
     $themeProfile = $objShowcaseTheme->getThemeProfile($showcaseID);
     if ($showcaseID > 0 && !is_null($themeProfile)) {
         $showcaseData = $objJSNShowcase->getShowcaseByID($showcaseID);
     } elseif ($showcaseID > 0 && is_null($themeProfile)) {
         $theme = JRequest::getVar('theme');
         $showcaseTable = JTable::getInstance('showcase', 'Table');
         $showcaseTable->showcase_id = $showcaseID;
         $showcaseTable->theme_name = $theme;
         $showcaseData = $showcaseTable;
     } else {
         $theme = JRequest::getVar('theme');
         $showcaseTable = JTable::getInstance('showcase', 'Table');
         $showcaseTable->showcase_id = 0;
         $showcaseTable->theme_name = $theme;
         $showcaseData = $showcaseTable;
     }
     $objJSNUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = dirname($objJSNUtils->overrideURL()) . '/';
     $dataObj = $objJSNShowcase->getShowcase2JSON($showcaseData, $URL);
     echo json_encode($dataObj);
     jexit();
 }
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:36,代码来源:view.showcase.php


示例13: revert

 public function revert()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $pks = $app->input->post->get('cid', array(), 'array');
     $pk = (int) count($pks) ? $pks[0] : 0;
     $type = $app->input->post->getString('element_type', 'type');
     $model = $this->getModel();
     $user = JFactory::getUser();
     $res = $user->authorise('core.edit', CCK_COM) ? $model->revert($pk, $type) : false;
     if ($res) {
         if ($type == 'search') {
             $link = _C4_LINK;
         } elseif ($type == 'type') {
             $link = _C2_LINK;
         }
         $msg = JText::_('COM_CCK_SUCCESSFULLY_RESTORED');
         $type = 'message';
     } else {
         $link = _C6_LINK . '&filter_e_type=' . $type;
         $msg = JText::_('JERROR_AN_ERROR_HAS_OCCURRED');
         $type = 'error';
     }
     $this->setRedirect($link, $msg, $type);
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:25,代码来源:versions.php


示例14: apply

 function apply()
 {
     JRequest::checkToken() or jexit('Invalid Token');
     $applicant = JRequest::get('POST');
     jimport('joomla.utilities.date');
     $now = new JDate();
     if ($applicant['job_id'] != 0) {
         $unsol_id = $applicant['id'];
         $applicant['id'] = false;
         $applicant['request_date'] = $now->toMySQL();
         $record =& JTable::getInstance('Applicant', 'Table');
         if (!$record->save($applicant)) {
             // uh oh failed to save
             JError::raiseError('500', JTable::getError());
         }
         $unsol =& JTable::getInstance('Unsolicited', 'Table');
         if (!$unsol->delete($unsol_id)) {
             // uh oh failed to delete
             JError::raiseError('500', JTable::getError());
         }
         $this->extendApply($applicant);
     } else {
         $applicant['last_updated'] = $now->toMySQL();
         $unsol_record =& JTable::getInstance('Unsolicited', 'Table');
         if (!$unsol_record->save($applicant)) {
             // uh oh failed to save
             JError::raiseError('500', JTable::getError());
         }
         $this->extendApply($applicant);
     }
 }
开发者ID:Rayvid,项目名称:joomla-jobboard,代码行数:31,代码来源:unsolicitededit.php


示例15: display

 public function display($cachable = false, $urlparams = false)
 {
     header('Content-type: text/html; charset=ISO-8859-1');
     $params = JComponentHelper::getParams('com_jak2filter');
     $indexing = (int) $params->get('indexing_cron', 1);
     $interval = (int) $params->get('indexing_interval', 900);
     $interval = $interval * 60;
     $cronkey = $params->get('indexing_cron_key', 'indexing');
     if (!$indexing) {
         return;
     }
     $db = JFactory::getDbo();
     $query = "SELECT updatetime FROM #__jak2filter WHERE `name` = 'cron'";
     $db->setQuery($query);
     $updatetime = $db->loadResult();
     $updatetime = !$updatetime ? 0 : strtotime($updatetime);
     $key = JRequest::getVar('jakey');
     $run = $updatetime + $interval < time() || $key == $cronkey;
     if ($run) {
         $now = date('Y-m-d H:i:s');
         $query = "\n\t\t\t\t\tINSERT INTO #__jak2filter\n\t\t\t\t\tSET \n\t\t\t\t\t\t`name` = 'cron',\n\t\t\t\t\t\t`updatetime` = " . $db->quote($now) . ",\n\t\t\t\t\t\t`value` = 1\n\t\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\t\t`updatetime` = " . $db->quote($now) . ",\n\t\t\t\t\t\t`value` = 1\n\t\t\t\t\t";
         $db->setQuery($query);
         $db->query();
         //
         $helper = new JAK2FilterHelper();
         $helper->indexingData('cron');
     } else {
         $msg = JText::sprintf('The cron job will be run on %s', date('Y-m-d H:i:s', $updatetime + $interval));
         jexit($msg);
     }
 }
开发者ID:jamielaff,项目名称:als_resourcing,代码行数:31,代码来源:cron.php


示例16: publish

 /**
  * Method to change the state of a list of records.
  */
 public function publish()
 {
     // Check for request forgeries.
     JRequest::checkToken() or jexit(JText::_('JInvalid_Token'));
     // Initialise variables.
     $user = JFactory::getUser();
     $ids = JRequest::getVar('cid', array(), '', 'array');
     $values = array('publish' => 1, 'unpublish' => 0, 'trash' => -2);
     $task = $this->getTask();
     $value = JArrayHelper::getValue($values, $task, 0, 'int');
     if (empty($ids)) {
         JError::raiseWarning(500, JText::_('JError_No_items_selected'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Change the state of the records.
         if (!$model->publish($ids, $value)) {
             JError::raiseWarning(500, $model->getError());
         } else {
             if ($value == 1) {
                 $text = 'JSuccess_N_Items_published';
             } else {
                 if ($value == 0) {
                     $text = 'JSuccess_N_Items_unpublished';
                 } else {
                     $text = 'JSuccess_N_Items_trashed';
                 }
             }
             $this->setMessage(JText::sprintf($text, count($ids)));
         }
     }
     $this->setRedirect('index.php?option=com_messages&view=messages');
 }
开发者ID:joebushi,项目名称:joomla,代码行数:36,代码来源:messages.php


示例17: delete

 public function delete()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $cid = $app->input->get('cid', array(), 'array');
     if (!is_array($cid) || count($cid) < 1) {
         JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Make sure the item ids are integers
         jimport('joomla.utilities.arrayhelper');
         JArrayHelper::toInteger($cid);
         // Remove the items.
         if ($model->delete($cid)) {
             $this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
         } else {
             $this->setMessage($model->getError());
         }
     }
     $vars = '';
     $extension = $app->input->get('extension', '');
     if ($extension) {
         $vars = '&extension=' . $extension;
     }
     $this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $vars, false));
 }
开发者ID:hamby,项目名称:SEBLOD,代码行数:27,代码来源:sessions.php


示例18: save

 public function save()
 {
     JRequest::checkToken('request') or jexit('Invalid Token');
     $mainframe = JFactory::getApplication();
     $post = JRequest::get('post');
     $ids = isset($post['id']) ? $post['id'] : '';
     $starts = isset($post['start']) ? $post['start'] : '';
     $ends = isset($post['end']) ? $post['end'] : '';
     $titles = isset($post['title']) ? $post['title'] : '';
     $removal = isset($post['itemRemove']) ? $post['itemRemove'] : '';
     $model = DiscussHelper::getModel('Ranks', true);
     if (!empty($removal)) {
         $rids = explode(',', $removal);
         $model->removeRanks($rids);
     }
     if (!empty($ids)) {
         if (count($ids) > 0) {
             for ($i = 0; $i < count($ids); $i++) {
                 $data = array();
                 $data['id'] = $ids[$i];
                 $data['start'] = $starts[$i];
                 $data['end'] = $ends[$i];
                 $data['title'] = $titles[$i];
                 $ranks = DiscussHelper::getTable('Ranks');
                 $ranks->bind($data);
                 $ranks->store();
             }
         }
         //end if
     }
     //end if
     $message = JText::_('COM_EASYDISCUSS_RANKING_SUCCESSFULLY_UPDATED');
     DiscussHelper::setMessageQueue($message, DISCUSS_QUEUE_SUCCESS);
     $mainframe->redirect('index.php?option=com_easydiscuss&view=ranks');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:35,代码来源:ranks.php


示例19: display

 function display($tpl = null)
 {
     global $mainframe, $option;
     jimport('joomla.utilities.simplexml');
     $showCaseID = JRequest::getInt('showcase_id', 0);
     if ($showCaseID == 0) {
         $menu =& JSite::getMenu();
         $item = $menu->getActive();
         $params =& $menu->getParams($item->id);
         $showcase_id = $params->get('showcase_id', 0);
     } else {
         $showcase_id = $showCaseID;
     }
     $objUtils = JSNISFactory::getObj('classes.jsn_is_utils');
     $URL = $objUtils->overrideURL();
     $objJSNShowcase = JSNISFactory::getObj('classes.jsn_is_showcase');
     $row = $objJSNShowcase->getShowCaseByID($showcase_id);
     if (count($row) <= 0) {
         header("HTTP/1.0 404 Not Found");
         exit;
     }
     $objJSNJSON = JSNISFactory::getObj('classes.jsn_is_json');
     $dataObj = $objJSNShowcase->getShowcase2JSON($row, $URL);
     echo $objJSNJSON->encode($dataObj);
     jexit();
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:26,代码来源:view.showcase.php


示例20: create

 public function create()
 {
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Get form data
     $pks = $this->input->post->get('cid', array(), 'array');
     $model = $this->getModel('Profile', 'GamificationModel');
     /** @var $model GamificationModelProfile */
     $pks = Joomla\Utilities\ArrayHelper::toInteger($pks);
     // Check for validation errors.
     if (!$pks) {
         $this->defaultLink .= '&view=' . $this->view_list;
         $this->setMessage(JText::_('COM_GAMIFICATION_INVALID_ITEM'), 'notice');
         $this->setRedirect(JRoute::_($this->defaultLink, false));
         return;
     }
     try {
         $pks = $model->filterProfiles($pks);
         if (!$pks) {
             $this->defaultLink .= '&view=' . $this->view_list;
             $this->setMessage(JText::_('COM_GAMIFICATION_INVALID_ITEM'), 'notice');
             $this->setRedirect(JRoute::_($this->defaultLink, false));
             return;
         }
         $model->create($pks);
     } catch (Exception $e) {
         JLog::add($e->getMessage(), JLog::ERROR, 'com_gamification');
         throw new Exception(JText::_('COM_GAMIFICATION_ERROR_SYSTEM'));
     }
     $msg = JText::plural('COM_GAMIFICATION_N_PROFILES_CREATED', count(pks));
     $link = $this->defaultLink . '&view=' . $this->view_list;
     $this->setRedirect(JRoute::_($link, false), $msg);
 }
开发者ID:ITPrism,项目名称:GamificationDistribution,代码行数:32,代码来源:profiles.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP jget函数代码示例发布时间:2022-05-15
下一篇:
PHP jetpack_the_site_logo函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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