コード例 #1
2
ファイル: controller.php プロジェクト: Simarpreet05/joomla
 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/users.php';
     // Load the submenu.
     UsersHelper::addSubmenu(JRequest::getCmd('view', 'users'));
     $view = JRequest::getCmd('view', 'users');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     if (!$this->canView($view)) {
         JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     // Check for edit form.
     if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));
         return false;
     } elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false));
         return false;
     } elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false));
         return false;
     }
     return parent::display();
 }
コード例 #2
1
ファイル: controller.php プロジェクト: Simarpreet05/joomla
 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/menus.php';
     // Load the submenu.
     MenusHelper::addSubmenu(JRequest::getCmd('view'));
     $view = JRequest::getCmd('view', 'menus');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     // Check for edit form.
     if ($view == 'menu' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.menu', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false));
         return false;
     } elseif ($view == 'item' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.item', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_menus&view=items', false));
         return false;
     }
     parent::display();
     return $this;
 }
コード例 #3
0
ファイル: animals.php プロジェクト: snellcode/ARCNA-Animals
 function getState($property = null)
 {
     if (!$this->__state_set) {
         $option = JRequest::getCmd('option');
         $app =& JFactory::getApplication();
         $context = $option . '.' . $this->getName();
         $this->setState('filter_published', $app->getUserStateFromRequest($context . '.filter_published', 'filter_published', 0, 'int'));
         $this->setState('filter_catid', $app->getUserStateFromRequest($context . '.filter_catid', 'filter_catid', 0, 'int'));
         $this->setState('filter_species', $app->getUserStateFromRequest($context . '.filter_species', 'filter_species', 0, 'word'));
         $this->setState('filter_location_state', $app->getUserStateFromRequest($context . '.filter_location_state', 'filter_location_state', 0, 'word'));
         $this->setState('filter_adoption_status', $app->getUserStateFromRequest($context . '.filter_adoption_status', 'filter_adoption_status', 0, 'word'));
         $this->setState('filter_real_time_need', $app->getUserStateFromRequest($context . '.filter_real_time_need', 'filter_real_time_need', 0, 'word'));
         $this->setState('filter_real_time_status', $app->getUserStateFromRequest($context . '.filter_real_time_status', 'filter_real_time_status', 0, 'word'));
         $this->setState('filter_search', $app->getUserStateFromRequest($context . '.filter_search', 'filter_search', ''));
         $this->setState('filter_order', $app->getUserStateFromRequest($context . '.filter_order', 'filter_order', 'title', 'cmd'));
         $this->setState('filter_order_Dir', $app->getUserStateFromRequest($context . '.filter_order_Dir', 'filter_order_Dir', 'ASC', 'word'));
         $limit = $app->getUserStateFromRequest($context . '.limit', 'limit', $app->getCfg('list_limit', 5), 'int');
         //strange limitstart
         //	$limitstart	= $app->getUserStateFromRequest( $context.'.limitstart', 'limitstart', 0, 'int' );
         $limitstart = JRequest::getInt('limitstart', 0, '', 'int');
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limit', $limit);
         $this->setState('limitstart', $limitstart);
         $this->__state_set = true;
     }
     return parent::getState($property);
 }
コード例 #4
0
ファイル: filter.php プロジェクト: unrealprojects/journal
 function process()
 {
     if (!$this->isAllowed('lists', 'filter')) {
         return;
     }
     JRequest::checkToken() or die('Invalid Token');
     $filid = JRequest::getInt('filid');
     if (!empty($filid)) {
         $this->store();
     }
     $filterClass = acymailing_get('class.filter');
     $filterClass->subid = JRequest::getString('subid');
     $filterClass->execute(JRequest::getVar('filter'), JRequest::getVar('action'));
     if (!empty($filterClass->report)) {
         if (JRequest::getCmd('tmpl') == 'component') {
             echo acymailing_display($filterClass->report, 'info');
             $js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=subscriber'; }";
             $doc = JFactory::getDocument();
             $doc->addScriptDeclaration($js);
             return;
         } else {
             $app = JFactory::getApplication();
             foreach ($filterClass->report as $oneReport) {
                 $app->enqueueMessage($oneReport);
             }
         }
     }
     return $this->edit();
 }
コード例 #5
0
ファイル: topicicons.php プロジェクト: rich20/Kunena
	function save() {
		$app = JFactory::getApplication ();
		$db = JFactory::getDBO ();
		if (!JRequest::checkToken()) {
			$app->enqueueMessage ( JText::_ ( 'COM_KUNENA_ERROR_TOKEN' ), 'error' );
			$app->redirect ( KunenaRoute::_($this->baseurl, false) );
			return;
		}

		$iconname = JRequest::getString ( 'topiciconname' );
		$filename = JRequest::getString ( 'topiciconslist' );
		$published = JRequest::getInt ( 'published' );
		$ordering = JRequest::getInt ( 'ordering', 0 );
		$topiciconid = JRequest::getInt( 'topiciconid', 0 );

		/*if ( !$topiciconid ) {
			$db->setQuery ( "INSERT INTO #__kunena_topics_icons SET name = '$iconname', filename = '$filename', published = '$published', ordering ='$ordering'" );
			$db->query ();
			if (KunenaError::checkDatabaseError()) return;
		} else {
			$db->setQuery ( "UPDATE #__kunena_topics_icons SET name = '$iconname', filename = '$filename', published = '$published', ordering ='$ordering' WHERE id = '$topiciconid'" );
			$db->query ();
			if (KunenaError::checkDatabaseError()) return;
		}*/

		$app->enqueueMessage ( JText::_('COM_KUNENA_TOPICICON_SAVED') );
		$app->redirect ( KunenaRoute::_($this->baseurl, false) );
	}
コード例 #6
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     $client = JRequest::getWord('client', 'admin');
     $model = $this->getModel();
     $this->document->setTitle(WFText::_('WF_PREFERENCES_TITLE'));
     $this->document->addStyleSheet('templates/system/css/system.css');
     $component = WFExtensionHelper::getComponent();
     $xml = JPATH_COMPONENT . '/models/preferences.xml';
     // get params definitions
     $params = new WFParameter($component->params, $xml, 'preferences');
     $params->addElementPath(JPATH_COMPONENT . '/elements');
     if (WFModel::authorize('admin')) {
         $form = $model->getForm('permissions');
     } else {
         $form = null;
     }
     $this->assign('params', $params);
     $this->assign('permissons', $form);
     $this->addStyleSheet('components/com_jce/media/css/preferences.css');
     $this->addScript('components/com_jce/media/js/preferences.js');
     if (JRequest::getInt('close') == 1) {
         $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.close();});');
     } else {
         $this->addScriptDeclaration('jQuery(document).ready(function($){$.jce.Preferences.init();});');
     }
     parent::display($tpl);
 }
コード例 #7
0
ファイル: view.html.php プロジェクト: ForAEdesWeb/AEW4
 function display($tpl = null)
 {
     $lists = array();
     $condition = $this->get('condition');
     $optionFields = $this->get('optionFields');
     $allFields = $this->get('allFields');
     foreach ($allFields as $field) {
         foreach ($optionFields as $i => $optionField) {
             if ($field->ComponentId == $optionField->ComponentId) {
                 $optionField->ComponentName = $field->PropertyValue;
                 $optionFields[$i] = $optionField;
                 break;
             }
         }
     }
     $actions = array(JHTML::_('select.option', 'show', JText::_('RSFP_CONDITION_SHOW')), JHTML::_('select.option', 'hide', JText::_('RSFP_CONDITION_HIDE')));
     $lists['action'] = JHTML::_('select.genericlist', $actions, 'action', '', 'value', 'text', $condition->action);
     $blocks = array(JHTML::_('select.option', 1, JText::_('RSFP_CONDITION_BLOCK')), JHTML::_('select.option', 0, JText::_('RSFP_CONDITION_FIELD')));
     $lists['block'] = JHTML::_('select.genericlist', $blocks, 'block', '', 'value', 'text', $condition->block);
     $conditions = array(JHTML::_('select.option', 'all', JText::_('RSFP_CONDITION_ALL')), JHTML::_('select.option', 'any', JText::_('RSFP_CONDITION_ANY')));
     $lists['condition'] = JHTML::_('select.genericlist', $conditions, 'condition', '', 'value', 'text', $condition->condition);
     $operators = array(JHTML::_('select.option', 'is', JText::_('RSFP_CONDITION_IS')), JHTML::_('select.option', 'is_not', JText::_('RSFP_CONDITION_IS_NOT')));
     $lists['allfields'] = JHTML::_('select.genericlist', $allFields, 'component_id', '', 'ComponentId', 'PropertyValue', $condition->component_id);
     $this->lang = $this->get('lang');
     $this->operators = $operators;
     $this->allFields = $allFields;
     $this->optionFields = $optionFields;
     $this->formId = $this->get('formId');
     $this->close = JRequest::getInt('close');
     $this->condition = $condition;
     $this->lists = $lists;
     parent::display($tpl);
 }
コード例 #8
0
 function save()
 {
     $mainframe = JFactory::getApplication();
     $id = JRequest::getInt("id");
     $deliveryTimes = JSFactory::getTable('deliveryTimes', 'jshop');
     $post = JRequest::get("post");
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeSaveDeliveryTime', array(&$post));
     if (!$deliveryTimes->bind($post)) {
         JError::raiseWarning("", _JSHOP_ERROR_BIND);
         $this->setRedirect("index.php?option=com_jshopping&controller=deliverytimes");
         return 0;
     }
     if (!$deliveryTimes->store()) {
         JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
         $this->setRedirect("index.php?option=com_jshopping&controller=deliverytimes");
         return 0;
     }
     $dispatcher->trigger('onAfterSaveDeliveryTime', array(&$deliveryTimes));
     if ($this->getTask() == 'apply') {
         $this->setRedirect("index.php?option=com_jshopping&controller=deliverytimes&task=edit&id=" . $deliveryTimes->id);
     } else {
         $this->setRedirect("index.php?option=com_jshopping&controller=deliverytimes");
     }
 }
コード例 #9
0
 function display($tpl = null)
 {
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_mijopolls/assets/css/mijopolls.css');
     $title = $this->get('Title');
     $t_title = $title ? JText::_('COM_MIJOPOLLS_VOTES_FOR') . ': ' . $title : JText::_('COM_MIJOPOLLS_SELECT_POLL');
     JToolBarHelper::title($t_title, 'mijopolls');
     JToolBarHelper::deleteList(JText::_('COM_MIJOPOLLS_DELETE_CONFIRM'), "deleteVotes", JText::_('COM_MIJOPOLLS_DELETE'), true);
     JToolBarHelper::divider();
     JToolBarHelper::preferences('com_mijopolls', 500);
     $this->mainframe = JFactory::getApplication();
     $this->option = JRequest::getWord('option');
     $filter_order = $this->mainframe->getUserStateFromRequest($this->option . '.votes.filter_order', 'filter_order', 'v.date', 'cmd');
     $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . '.votes.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $this->mainframe->getUserStateFromRequest($this->option . '.votes.search', 'search', '', 'string');
     // Get data from the model
     $lists = $this->get('List');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->title = $title;
     $this->lists = $lists;
     $this->votes = $this->get('Data');
     $this->pagination = $this->get('Pagination');
     $this->poll_id = JRequest::getInt('id', 0);
     parent::display($tpl);
 }
コード例 #10
0
 /**
  * Deletes a file from the system.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  */
 public function delete()
 {
     // Check for request forgeries
     FD::checkToken();
     // Only logged in users are allowed to delete anything
     FD::requireLogin();
     // Get the current view
     $view = $this->getCurrentView();
     // Get the current user
     $my = FD::user();
     // Get the uploader id
     $id = JRequest::getInt('id');
     $uploader = FD::table('Uploader');
     $uploader->load($id);
     // Check if the user is really permitted to delete the item
     if (!$id || !$uploader->id || $uploader->user_id != $my->id) {
         return $view->call(__FUNCTION__);
     }
     $state = $uploader->delete();
     // If deletion fails, silently log the error
     if (!$state) {
         FD::logError(__FILE__, __LINE__, JText::_('UPLOADER: Unable to delete the item [' . $uploader->id . '] because ' . $uploader->getError()));
     }
     return $view->call(__FUNCTION__);
 }
コード例 #11
0
ファイル: rivals.php プロジェクト: Heart1010/JoomLeague
 function __construct()
 {
     parent::__construct();
     $this->projectid = JRequest::getInt("p", 0);
     $this->teamid = JRequest::getInt("tid", 0);
     $this->getTeam();
 }
コード例 #12
0
ファイル: view.html.php プロジェクト: Rayvid/joomla-jobboard
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document =& JFactory::getDocument();
     $this->_addScripts();
     if ($this->published) {
         jimport('joomla.utilities.date');
         //$this->config = & $this->get('ShareConfig', 'Config');
         $this->assign('setstate', JobBoardHelper::renderJobBoard());
         if ($this->config->use_location) {
             $job_location = $this->data->country_name != 'COM_JOBBOARD_DB_ANYWHERE_CNAME' ? ', ' . $this->data->city : ', ' . JText::_('WORK_FROM_ANYWHERE');
         } else {
             $job_location = '';
         }
         $ref_num = $this->data->ref_num != '' ? ' (' . JText::_('COM_JOBBOARD_ENT_REF') . ': ' . $this->data->ref_num . ')' : '';
         $document->setTitle(JText::_('EMAIL_JOB') . ': ' . $this->data->job_title . $job_location . $ref_num);
     } else {
         $document->setTitle(JText::_('COM_JOBBOARD_JOB_DISABLED'));
     }
     $this->itemid = JRequest::getInt('Itemid');
     $this->user_entry_point = 'com_users';
     if (version_compare(JVERSION, '2.5.0', 'ge') || version_compare(JVERSION, '1.7.0', 'ge') || version_compare(JVERSION, '1.6.0', 'ge')) {
         $this->user_entry_point = 'com_users';
     } elseif (version_compare(JVERSION, '1.5.0', 'ge')) {
         $this->user_entry_point = 'com_user';
     }
     $retries = $app->getUserState('com_jobboard.member.retry', 0, 'int');
     $this->retries = $retries;
     parent::display($tpl);
 }
コード例 #13
0
 /**
  * Collect the filters for the query
  * @author RolandD
  * @author Max Milbers
  */
 private function getInventoryFilter()
 {
     /* Check some filters */
     $filters = array();
     if ($search = JRequest::getVar('filter_inventory', false)) {
         $search = '"%' . $this->_db->escape($search, true) . '%"';
         //$search = $this->_db->Quote($search, false);
         $filters[] = '`#__virtuemart_products`.`product_name` LIKE ' . $search;
     }
     if (JRequest::getInt('stockfilter', 0) == 1) {
         $filters[] = '`#__virtuemart_products`.`product_in_stock` > 0';
     }
     if ($catId = JRequest::getInt('virtuemart_category_id', 0) > 0) {
         $filters[] = '`#__virtuemart_categories`.`virtuemart_category_id` = ' . $catId;
     }
     $published = JRequest::getvar('filter_published');
     if ($published === '1') {
         $filters[] = "`#__virtuemart_products`.`published` = 1 ";
     } else {
         if ($published === '0') {
             $filters[] = "`#__virtuemart_products`.`published` = 0 ";
         }
     }
     $filters[] = '(`#__virtuemart_shoppergroups`.`default` = 1 OR `#__virtuemart_shoppergroups`.`default` is NULL)';
     return ' WHERE ' . implode(' AND ', $filters) . $this->_getOrdering();
 }
コード例 #14
0
    function licenseDocumentForm(&$links, &$paths, &$data, $inline = 0)
    {
        $action = _taskLink('license_result', JRequest::getInt('gid', 0), array('bid' => $data->id));
        ob_start();
        ?>
		<form action="<?php 
        echo DOCMAN_Compat::sefRelToAbs($action);
        ?>
" method="POST" enctype="multipart/form-data">
            <input type="hidden" name="inline" value="<?php 
        echo $inline;
        ?>
" />
			<input type="radio" name="agree" value="0" checked /><?php 
        echo _DML_DONT_AGREE;
        ?>
			<input type="radio" name="agree" value="1" /><?php 
        echo _DML_AGREE;
        ?>
<br /><br />
			<input name="submit" value="<?php 
        echo _DML_PROCEED;
        ?>
" type="submit" />
		</form>

		<?php 
        $html = ob_get_contents();
        ob_end_clean();
        return $html;
    }
コード例 #15
0
 /**
  * Gets the URL arguments to append to an item redirect.
  *
  * @param     int       $id         The primary key id for the item.
  * @param     string    $url_var    The name of the URL variable for the id.
  *
  * @return    string                The arguments to append to the redirect URL.
  */
 protected function getRedirectToItemAppend($id = null, $url_var = 'id')
 {
     // Need to override the parent method completely.
     $tmpl = JRequest::getCmd('tmpl');
     $layout = JRequest::getCmd('layout');
     $item_id = JRequest::getInt('Itemid');
     $return = $this->getReturnPage();
     $append = '';
     // Setup redirect info.
     if ($tmpl) {
         $append .= '&tmpl=' . $tmpl;
     }
     if ($layout) {
         $append .= '&layout=' . $layout;
     }
     if ($id) {
         $append .= '&' . $id . '=' . $id;
     }
     if ($item_id) {
         $append .= '&Itemid=' . $item_id;
     }
     if ($return) {
         $append .= '&return=' . base64_encode($return);
     }
     return $append;
 }
コード例 #16
0
ファイル: board.php プロジェクト: nvthuong11/tz_pinboard
 function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     if ($layout = $app->input->get('layout')) {
         $this->context .= '.' . $layout;
     }
     $filer_auto = $this->getUserStateFromRequest($this->context . '.filter.author.id', 'filter_author_id', '');
     $filer_search = $this->getUserStateFromRequest($this->context . '.filler.search', 'filter_search', '');
     $filert_order = $this->getUserStateFromRequest($this->context . '.filter.order', 'filter_order', '');
     $filert_order_dir = $this->getUserStateFromRequest($this->context . '.filert.order.dir', 'filter_order_Dir', '');
     $limit = $this->getUserStateFromRequest($this->context . 'limit', 'limit', '');
     $limitstartt = $this->getUserStateFromRequest($this->context . 'limitstart', 'limitstart', '');
     $filter_published = $this->getUserStateFromRequest($this->context . 'filter_published', 'filter_published', '');
     $id_cm = $this->getUserStateFromRequest($this->context . '.id_cm', 'id', '');
     $this->setState('status', $filter_published);
     $this->setState('id_cm', $id_cm);
     // $this->setState('autho',$filer_auto);
     $this->setState('lab1', $filert_order);
     $this->setState('lab2', $filert_order_dir);
     $this->setState('search', $filer_search);
     $this->setState('autho', $filer_auto);
     if (isset($_POST['cid'])) {
         $this->setState('id_input', $_POST['cid']);
     }
     $this->setState('detail2', JRequest::getInt('id'));
     $this->setState('limi', $limit);
     $this->setState('limitstar', $limitstartt);
 }
コード例 #17
0
 function save()
 {
     $id = JRequest::getInt("id");
     $configdisplayprice = JSFactory::getTable('configDisplayPrice', 'jshop');
     $post = JRequest::get("post");
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onBeforeSaveConfigDisplayPrice', array(&$post));
     if (!$post['countries_id']) {
         JError::raiseWarning("", _JSHOP_ERROR_BIND);
         $this->setRedirect("index.php?option=com_jshopping&controller=configdisplayprice&task=edit&id=" . $post['id']);
         return 0;
     }
     if (!$configdisplayprice->bind($post)) {
         JError::raiseWarning("", _JSHOP_ERROR_BIND);
         $this->setRedirect("index.php?option=com_jshopping&controller=configdisplayprice");
         return 0;
     }
     $configdisplayprice->setZones($post['countries_id']);
     if (!$configdisplayprice->store()) {
         JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
         $this->setRedirect("index.php?option=com_jshopping&controller=configdisplayprice");
         return 0;
     }
     updateCountConfigDisplayPrice();
     $dispatcher->trigger('onAftetSaveConfigDisplayPrice', array(&$configdisplayprice));
     if ($this->getTask() == 'apply') {
         $this->setRedirect("index.php?option=com_jshopping&controller=configdisplayprice&task=edit&id=" . $configdisplayprice->id);
     } else {
         $this->setRedirect("index.php?option=com_jshopping&controller=configdisplayprice");
     }
 }
コード例 #18
0
ファイル: view.showcase.php プロジェクト: sangkasi/joomla
 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();
 }
コード例 #19
0
ファイル: import.php プロジェクト: juliano-hallac/fabrik
 function doimport()
 {
     $model =& $this->getModel('Importcsv', 'FabrikFEModel');
     if (!$model->import()) {
         $this->display();
         return;
     }
     $id = $model->getListModel()->getId();
     $document = JFactory::getDocument();
     $viewName = JRequest::getVar('view', 'form', 'default', 'cmd');
     $viewType = $document->getType();
     // Set the default view name from the Request
     $view =& $this->getView($viewName, $viewType);
     $Itemid = JRequest::getInt('Itemid');
     if (!empty($model->newHeadings)) {
         //as opposed to admin you can't alter table structure with a CSV import
         //from the front end
         JError::raiseNotice(500, $model->_makeError());
         $this->setRedirect("index.php?option=com_fabrik&view=import&fietype=csv&listid=" . $id . "&Itemid=" . $Itemid);
     } else {
         JRequest::setVar('fabrik_list', $id);
         $msg = $model->makeTableFromCSV();
         $this->setRedirect('index.php?option=com_fabrik&view=list&listid=' . $id . "&resetfilters=1&Itemid=" . $Itemid, $msg);
     }
 }
コード例 #20
0
 function __construct()
 {
     parent::__construct();
     $this->projectid = JRequest::getInt('p', 0);
     $this->personid = JRequest::getInt('pid', 0);
     $this->teamid = JRequest::getInt('tid', 0);
 }
コード例 #21
0
ファイル: view.html.php プロジェクト: juliano-hallac/fabrik
 function display($tmpl = 'default')
 {
     require_once COM_FABRIK_FRONTEND . DS . 'helpers' . DS . 'html.php';
     $model = $this->getModel();
     $usersConfig = JComponentHelper::getParams('com_fabrik');
     $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0)));
     $model->setId($id);
     $this->assign('id', $id);
     $this->assignRef('row', $this->get('Visualization'));
     $this->assign('rows', $this->get('Rows'));
     $this->assign('containerId', $this->get('ContainerId'));
     $this->calName = $this->get('VizName');
     $this->assignRef('params', $this->get('PluginParams'));
     $tmpl = $this->params->get('approvals_layout', $tmpl);
     $tmplpath = JPATH_SITE . DS . 'plugins' . DS . 'fabrik_visualization' . DS . 'approvals' . DS . 'views' . DS . 'approvals' . DS . 'tmpl' . DS . $tmpl;
     $this->_setPath('template', $tmplpath);
     $ab_css_file = $tmplpath . DS . "template.css";
     if (file_exists($ab_css_file)) {
         JHTML::stylesheet('/plugins/fabrik_visualization/approvals/views/approvals/tmpl/' . $tmpl . '/template.css');
     }
     FabrikHelperHTML::script('plugins/fabrik_visualization/approvals/approvals.js', true, "var approvals = new fbVisApprovals('approvals_" . $id . "');");
     $text = $this->loadTemplate();
     $opt = JRequest::getVar('option');
     $view = JRequest::getCmd('view');
     JRequest::setVar('view', 'article');
     JRequest::setVar('option', 'com_content');
     jimport('joomla.html.html.content');
     $text .= '{emailcloak=off}';
     $text = JHTML::_('content.prepare', $text);
     $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text);
     JRequest::setVar('option', $opt);
     echo $text;
 }
コード例 #22
0
 function export()
 {
     $selectedMail = JRequest::getInt('filter_mail', 0);
     $selectedStatus = JRequest::getString('filter_status', '');
     $filters = array();
     if (!empty($selectedMail)) {
         $filters[] = 'a.mailid = ' . $selectedMail;
     }
     if (!empty($selectedStatus)) {
         if ($selectedStatus == 'bounce') {
             $filters[] = 'a.bounce > 0';
         } elseif ($selectedStatus == 'open') {
             $filters[] = 'a.open > 0';
         } elseif ($selectedStatus == 'notopen') {
             $filters[] = 'a.open < 1';
         } elseif ($selectedStatus == 'failed') {
             $filters[] = 'a.fail > 0';
         }
     }
     $query = 'SELECT `subid` FROM `#__acymailing_userstats` as a ';
     if (!empty($filters)) {
         $query .= ' WHERE (' . implode(') AND (', $filters) . ')';
     }
     $currentSession =& JFactory::getSession();
     $currentSession->set('acyexportquery', $query);
     $this->setRedirect(acymailing_completeLink('data&task=export&sessionquery=1', false, true));
 }
コード例 #23
0
ファイル: assignments.php プロジェクト: jtresca/nysurveyor
 function getRequestParams()
 {
     $params = new stdClass();
     $params->option = JRequest::getCmd('option');
     $params->view = JRequest::getCmd('view');
     $params->task = JRequest::getCmd('task');
     $params->id = JRequest::getInt('id');
     $params->Itemid = JRequest::getInt('Itemid');
     switch ($params->option) {
         case 'com_categories':
             $params->option = 'com_content';
             $params->view = 'category';
             break;
         case 'com_sections':
             $params->option = 'com_content';
             $params->view = 'section';
             break;
         case 'com_mr':
             $params->item_id = JRequest::getInt('article');
             $params->category_id = JRequest::getInt('category_id');
             $params->id = $params->item_id ? $params->item_id : $params->category_id;
             break;
         case 'com_zoo':
             $params->item_id = JRequest::getInt('item_id');
             $params->category_id = JRequest::getInt('category_id');
             $params->id = $params->item_id ? $params->item_id : $params->category_id;
             break;
     }
     if (!$params->id) {
         $cid = JRequest::getVar('cid', array(0), 'method', 'array');
         $cid = array((int) $cid['0']);
         $params->id = $cid['0'];
     }
     return $params;
 }
コード例 #24
0
ファイル: kaltura.php プロジェクト: Jobar87/fabrik
	private function getKalturaPage()
	{
		$page = JRequest::getInt('page'); // read the current page from the request.
		// page=1 is the first page
		if ($page < 1) $page = 1;
		return $page;
	}
コード例 #25
0
ファイル: sliders.php プロジェクト: NavaINT1876/ccustoms
 /**
  * Load the JavaScript behavior.
  *
  * @param   string  $group   The pane identifier.
  * @param   array   $params  Array of options.
  *
  * @return  void
  *
  * @since   11.1
  */
 protected static function _loadBehavior($group, $params = array())
 {
     static $loaded = array();
     if (!array_key_exists($group, $loaded)) {
         $loaded[$group] = true;
         // Include mootools framework.
         JHtml::_('behavior.framework', true);
         $document = JFactory::getDocument();
         $display = isset($params['startOffset']) && isset($params['startTransition']) && $params['startTransition'] ? (int) $params['startOffset'] : null;
         $show = isset($params['startOffset']) && !(isset($params['startTransition']) && $params['startTransition']) ? (int) $params['startOffset'] : null;
         $options = '{';
         $opt['onActive'] = "function(toggler, i) {toggler.addClass('pane-toggler-down');" . "toggler.removeClass('pane-toggler');i.addClass('pane-down');i.removeClass('pane-hide');Cookie.write('jpanesliders_" . $group . "',\$\$('div#" . $group . ".pane-sliders > .panel > h3').indexOf(toggler));}";
         $opt['onBackground'] = "function(toggler, i) {toggler.addClass('pane-toggler');" . "toggler.removeClass('pane-toggler-down');i.addClass('pane-hide');i.removeClass('pane-down');if(\$\$('div#" . $group . ".pane-sliders > .panel > h3').length==\$\$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler').length) Cookie.write('jpanesliders_" . $group . "',-1);}";
         $opt['duration'] = isset($params['duration']) ? (int) $params['duration'] : 300;
         $opt['display'] = isset($params['useCookie']) && $params['useCookie'] ? JRequest::getInt('jpanesliders_' . $group, $display, 'cookie') : $display;
         $opt['show'] = isset($params['useCookie']) && $params['useCookie'] ? JRequest::getInt('jpanesliders_' . $group, $show, 'cookie') : $show;
         $opt['opacity'] = isset($params['opacityTransition']) && $params['opacityTransition'] ? 'true' : 'false';
         $opt['alwaysHide'] = isset($params['allowAllClose']) && !$params['allowAllClose'] ? 'false' : 'true';
         foreach ($opt as $k => $v) {
             if ($v) {
                 $options .= $k . ': ' . $v . ',';
             }
         }
         if (substr($options, -1) == ',') {
             $options = substr($options, 0, -1);
         }
         $options .= '}';
         $js = "window.addEvent('domready', function(){ new Fx.Accordion(\$\$('div#" . $group . ".pane-sliders > .panel > h3.pane-toggler'), \$\$('div#" . $group . ".pane-sliders > .panel > div.pane-slider'), " . $options . "); });";
         $document->addScriptDeclaration($js);
     }
 }
コード例 #26
0
ファイル: plugin.php プロジェクト: affiliatelk/ecc
 function onAfterRoute()
 {
     $mainframe =& JFactory::getApplication();
     // SSL settings
     $uri =& JFactory::getURI();
     $redirect = false;
     // SSL
     $Itemid = JRequest::getInt('Itemid');
     $menu_items = $this->MijosefConfig->force_ssl;
     if (!empty($menu_items) && is_array($menu_items)) {
         if ($uri->isSSL() == false) {
             if (in_array($Itemid, $menu_items)) {
                 $redirect = true;
                 $uri->setScheme('https');
             }
         } else {
             if (!in_array($Itemid, $menu_items)) {
                 $redirect = true;
                 $uri->setScheme('http');
             }
         }
     }
     if ($redirect === true) {
         $mainframe->redirect($uri->toString());
         $mainframe->close();
     }
 }
コード例 #27
0
 public function generateJsonResponse($action, $do, $data)
 {
     $response = '';
     if (JDEBUG == 1 && defined('JFIREPHP')) {
         FB::log("Kunena JSON action: " . $action);
     }
     // Sanitize $data variable
     $data = $this->_db->getEscaped($data);
     if ($this->_my->id) {
         // We only entertain json requests for registered and logged in users
         switch ($action) {
             case 'autocomplete':
                 $response = $this->_getAutoComplete($do, $data);
                 break;
             case 'preview':
                 $body = JRequest::getVar('body', '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $response = $this->_getPreview($body);
                 break;
             case 'pollcatsallowed':
                 // TODO: deprecated
                 $response = $this->_getPollsCatsAllowed();
                 break;
             case 'pollvote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_addPollVote($vote, $id, $this->_my->id);
                 break;
             case 'pollchangevote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_changePollVote($vote, $id, $this->_my->id);
                 break;
             case 'anynomousallowed':
                 // TODO: deprecated
                 $response = $this->_anynomousAllowed();
                 break;
             case 'uploadfile':
                 $response = $this->_uploadFile($do);
                 break;
             case 'modtopiclist':
                 $response = $this->_modTopicList($data);
                 break;
             case 'removeattachment':
                 $response = $this->_removeAttachment($data);
                 break;
             default:
                 break;
         }
     } else {
         $response = array('status' => '-1', 'error' => JText::_('COM_KUNENA_AJAX_PERMISSION_DENIED'));
     }
     // Output the JSON data.
     return json_encode($response);
 }
コード例 #28
0
 function save()
 {
     $apply = JRequest::getVar("apply");
     $vendor = JSFactory::getTable('vendor', 'jshop');
     $dispatcher = JDispatcher::getInstance();
     $id = JRequest::getInt("id");
     $vendor->load($id);
     if (!isset($_POST['publish'])) {
         $_POST['publish'] = 0;
     }
     $post = JRequest::get("post");
     $dispatcher->trigger('onBeforeSaveVendor', array(&$post));
     $vendor->bind($post);
     JSFactory::loadLanguageFile();
     if (!$vendor->check()) {
         JError::raiseWarning("", $vendor->getError());
         $this->setRedirect("index.php?option=com_jshopping&controller=vendors&task=edit&id=" . $vendor->id);
         return 0;
     }
     if (!$vendor->store()) {
         JError::raiseWarning("", _JSHOP_ERROR_SAVE_DATABASE);
         $this->setRedirect("index.php?option=com_jshopping&controller=vendors&task=edit&id=" . $vendor->id);
         return 0;
     }
     $dispatcher->trigger('onAfterSaveVendor', array(&$vendor));
     if ($this->getTask() == 'apply') {
         $this->setRedirect("index.php?option=com_jshopping&controller=vendors&task=edit&id=" . $vendor->id);
     } else {
         $this->setRedirect("index.php?option=com_jshopping&controller=vendors");
     }
 }
コード例 #29
0
 function onPromoteData($id)
 {
     $db = JFactory::getDBO();
     $Itemid = JRequest::getInt('Itemid');
     $jschk = $this->_chkextension();
     if (!empty($jschk)) {
         $query = "SELECT cf.id FROM #__community_fields as cf\n\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cf.name like '%About me%' AND cfv.user_id=" . $id;
         $db->setQuery($query);
         $fieldid = $db->loadresult();
         $query = "SELECT u.name AS title, cu.avatar AS image, cfv.value AS bodytext\n\t\t\t\t\t\t\t\t\tFROM #__users AS u\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_users AS cu ON u.id=cu.userid\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields_values AS cfv ON cu.userid=cfv.user_id\n\t\t\t\t\t\t\t\t\tLEFT JOIN #__community_fields AS cf ON cfv.field_id=cf.id\n\t\t\t\t\t\t\t\t\tWHERE cu.userid =" . $id;
         if ($fieldid) {
             $query .= " AND cfv.field_id=" . $fieldid;
         }
         $db->setQuery($query);
         $previewdata = $db->loadObjectlist();
         if (!$fieldid) {
             $previewdata[0]->bodytext = '';
         }
         // Include Jomsocial core
         $jspath = JPATH_ROOT . DS . 'components' . DS . 'com_community';
         include_once $jspath . DS . 'libraries' . DS . 'core.php';
         $previewdata[0]->url = JUri::root() . substr(CRoute::_('index.php?option=com_community&view=profile&userid=' . $id), strlen(JUri::base(true)) + 1);
         if ($previewdata[0]->image == '') {
             $previewdata[0]->image = 'components/com_community/assets/user-Male.png';
         }
         return $previewdata;
     } else {
         return '';
     }
 }
コード例 #30
0
 function assignProp()
 {
     switch ($this->getTask()) {
         case 'deleteProperties':
             $action = 'delete';
             break;
         case 'replaceProperties':
             $action = 'replace';
             break;
         case 'addProperties':
         default:
             $action = 'add';
             break;
     }
     $return_to = 'index.php?option=com_customproperties&controller=assign&task=showContentItems';
     $ce_name = JRequest::getVar('ce_name', '');
     if ($ce_name != "") {
         $return_to .= "&ce_name={$ce_name}";
     }
     $section_id = JRequest::getInt('filter_sectionid', 0);
     if ($section_id != "0") {
         $return_to .= "&filter_sectionid={$section_id}";
     }
     $category_id = JRequest::getInt('filter_categoryid', 0);
     if ($category_id != "0") {
         $return_to .= "&filter_categoryid={$category_id}";
     }
     $limit = JRequest::getInt('limit', '');
     $return_to .= "&limit={$limit}";
     $limitstart = JRequest::getInt('limitstart', '');
     $return_to .= "&limitstart={$limitstart}";
     $model =& $this->getModel('assign');
     $model->assignCustomProperties($action);
     $this->setRedirect($return_to);
 }