/** * 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'); }
function save() { $data = JRequest::getVar('jform', array(), 'post', 'NONE', 4); $id = (int) $data['id']; if (empty($id)) { if (!igGeneralHelper::authorise('core.igalleryfront.create')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } } else { if (!igGeneralHelper::authorise('core.igalleryfront.edit', $id)) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } } $model = $this->getModel(); $msg = ''; if (!$model->save($data)) { JError::raise(2, 500, $model->getError()); } else { $msg = JText::_('SUCCESSFULLY_SAVED'); } switch ($this->task) { case 'apply': $url = 'index.php?option=com_igallery&view=icategory&id=' . $id; break; case 'save': $url = 'index.php?option=com_igallery&view=categories'; } $this->setRedirect(JRoute::_($url, false), $msg); }
public function __construct($contentElement) { $this->filterNullValue = -1; $this->filterType = "category"; $this->filterField = $contentElement->getFilter("category"); parent::__construct($contentElement); // if currently selected category is not compatible with section then reset if (intval(JRequest::getVar('filter_reset', 0))) { $this->section_filter_value = -1; } else { if ($this->rememberValues) { $this->section_filter_value = JFactory::getApplication()->getUserStateFromRequest('section_filter_value', 'section_filter_value', -1); } else { $this->section_filter_value = JRequest::getVar("section_filter_value", -1); } } if ($this->section_filter_value != -1 and $this->filter_value >= 0) { $cat = JTable::getInstance('category'); $cat->load($this->filter_value); if ($cat->section != $this->section_filter_value) { $this->filter_value = -1; } } if ($this->section_filter_value == 0) { $this->filter_value = 0; } }
function display($tpl = null) { global $mainframe, $option; $cid = JRequest::getVar('cid_user'); if (!is_array($cid)) { $mainframe->redirect('index.php?option=' . $option); return; } $user_id = $cid[0]; $model = $this->getModel('user'); $model->load($user_id); $this->_setToolBar(); $say = JText::sprintf('USER_RESOURCES_TITLE', $model->user->username); $root_node = JText::_('RESOURCES_TREE_ROOT_NODE'); $nowdate = JFactory::getDate(); $str_now = JHTML::_('date', $nowdate->toMySQL(), '%Y-%m-%d %H:%M:%S'); $this->assign('nowdate', $str_now); $this->assign('say', $say); $this->assign('root_node', $root_node); $this->assignRef('uid', $user_id); $this->assignRef('option', $option); //hide the menu JRequest::setVar('hidemainmenu', 1); parent::display(); }
/** * save function * * @return nothing */ public function save() { //$ids = JRequest::getVar('cid', array(), '', 'array'); // Get posted form variables. $task = $this->getTask(); $data = JRequest::getVar('jform', array(), 'post', 'array'); //echo "ECHO:: ".$data['id']; // echo " task:: ".$task; $session =& JFactory::getSession(); $articleid = $session->get('articleid'); $fieldsattachid = $session->get('fieldsattachid'); $model = $this->getModel(); if (!$model->store()) { return JError::raiseWarning(500, $model->getError()); } if ($task == "apply") { $msg = ""; $lastid = $data['id']; if (empty($lastid)) { $lastid = $model->lastid; } $link = 'index.php?option=com_fieldsattach&view=fieldsattachimage&layout=edit&id=' . $lastid . '&tmpl=component&fieldsattachid=' . $fieldsattachid . '&reload=true'; $this->setRedirect($link, $msg); } if ($task == "save") { $msg = ""; //$link= 'index.php?option=com_fieldsattach&view=fieldsattachimages&tmpl=component&articleid='.$articleid.'&fieldsattachid='.$fieldsattachid.'&reset=1' ; $link = 'index.php?option=com_fieldsattach&view=fieldsattachimages&tmpl=component&fieldsattachid=' . $fieldsattachid; $this->setRedirect($link, $msg); } }
public function display($tpl = null) { $document = & JFactory::getDocument(); $document->addStyleSheet('components/com_gglms/css/lista.css'); $document->addStyleSheet('components/com_gglms/css/jquery.dataTables.css'); $document->addStyleSheet('components/com_gglms/css/jquery.dataTables_themeroller.css'); $document->addScript('components/com_gglms/js/jquery.dataTables.js'); $model = & $this->getModel(); $tpl = JRequest::getVar('tpl'); if ($tpl == "byContent") { $contentStat = $model->getContentStat(); $this->assignRef('ContentStat', $contentStat); } if ($tpl == "byDate") { $AccesByDay = $model->getAccesByDay(); $this->assignRef('AccesByDay', $AccesByDay); } parent::display($tpl); }
function __construct() { $this->_mainframe = JFactory::getApplication(); $this->_task = JRequest::getVar('task', 0); $this->_view = JRequest::getVar('view', 0); $this->_params = XiptFactory::getSettings('', 0); }
/** * Method to get a JDatabaseQuery object for retrieving the data set from a database. * * @return object A JDatabaseQuery object to retrieve the data set. */ protected function getListQuery() { $w = explode('|', urldecode(JRequest::getVar('filterStr', ''))); $user = JFactory::getUser(); $filterStr = $w[0]; $filterAktiv = $w[1]; if ($filterAktiv == 1) { $lezartLimit = 1; } else { $lezartLimit = 99; } if ($filterStr != '') { $filterStr = ' and sz.megnevezes like "%' . $filterStr . '%"'; } $db = $this->getDbo(); $query = $db->getQuery(true); $catid = (int) $this->getState('authorlist.id', 1); $query = ' /* szavazások amik jelenleg vita1 állapotban vannak */ /* ================================================ */ SELECT sz.megnevezes, sz.vita1, sz.vita2, sz.szavazas, sz.lezart, sz.szavazas_vege, sz.titkos, sz.vita2_vege, sz.id, sz.temakor_id FROM #__szavazasok sz WHERE (sz.vita2=1) ' . $filterStr; $query .= ' order by ' . JRequest::getVar('order', '6'); return $query; }
function getData() { $cid = JRequest::getVar('cid'); $row =& JTable::getInstance('K2UserGroup', 'Table'); $row->load($cid); return $row; }
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(); }
/** * Method to unsubscribe newsletter * * @return void */ public function unsubscribe() { $post = JRequest::get('get'); $model = $this->getModel('newsletter'); $option = JRequest::getVar('option'); $Itemid = JRequest::getVar('Itemid'); $email = JRequest::getVar('email1'); $newsletteritemid = JRequest::getVar('newsletteritemid'); $menu = JFactory::getApplication()->getMenu(); $item = $menu->getItem($newsletteritemid); if ($item) { $return = $item->link . '&Itemid=' . $newsletteritemid; } else { $return = "index.php?option=com_redshop&view=newsletter&layout=thankyou&Itemid=" . $Itemid; } /* * check if user has subscribe or not. */ $alreadysubscriberbymail = $model->checksubscriptionbymail($email); if ($alreadysubscriberbymail) { $userhelper = new rsUserhelper(); if ($userhelper->newsletterUnsubscribe($email)) { $msg = JText::_('COM_REDSHOP_CANCLE_SUBSCRIPTION'); } else { $msg = JText::_('COM_REDSHOP_CANCLE_SUBSCRIPTION_FAIL'); } } else { $msg = JText::_('COM_REDSHOP_ALREADY_CANCLE_SUBSCRIPTION'); } $this->setRedirect($return, $msg); }
/** * Removes an item */ function delete() { // Check for request forgeries JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN')); // Initialise variables. $user = JFactory::getUser(); $ids = JRequest::getVar('cid', array(), '', 'array'); // Access checks. foreach ($ids as $i => $id) { if (!$user->authorise('core.delete', 'com_content.article.' . (int) $id)) { // Prune items that you can't delete. unset($ids[$i]); JError::raiseNotice(403, JText::_('JERROR_CORE_DELETE_NOT_PERMITTED')); } } if (empty($ids)) { JError::raiseWarning(500, JText::_('JERROR_NO_ITEMS_SELECTED')); } else { // Get the model. $model = $this->getModel(); // Remove the items. if (!$model->featured($ids, 0)) { JError::raiseWarning(500, $model->getError()); } } $this->setRedirect('index.php?option=com_content&view=featured'); }
/** * Adds an image to the list of the favourites * * @return void * @since 1.5.5 */ public function addImage() { $model = $this->getModel('favourites'); // Determine correct redirect URL if ($catid = JRequest::getInt('catid')) { // Request was initiated from category view $url = JRoute::_('index.php?view=category&catid=' . $catid, false); } elseif (($toplist = JRequest::getVar('toplist')) !== null) { // Request was initiated from toplist view if (empty($toplist)) { // Toplist view 'Most viewed' $url = JRoute::_('index.php?view=toplist', false); } else { // Any other toplist view $url = JRoute::_('index.php?view=toplist&type=' . $toplist, false); } } elseif (($sstring = JRequest::getVar('sstring')) !== null) { // Request was initiated from search view $url = JRoute::_('index.php?view=search&sstring=' . $sstring, false); } else { // Request was initiated from detail view or any other view $url = JRoute::_('index.php?view=detail&id=' . $model->getId(), false); } // Add the image to the list of favourite images if (!$model->addImage()) { $this->setRedirect($url, $model->getError(), 'error'); } else { // Message is set by the model $this->setRedirect($url); } }
public function getOptions() { // Must load admin language files $lang = JFactory::getLanguage(); $lang->load("com_jevents", JPATH_ADMINISTRATOR); $views = array(); include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php"; $exceptions_values = (string) $this->element['except'] ? (string) $this->element['except'] : ""; $exceptions = array(); $exceptions = explode(',', $exceptions_values); foreach (JEV_CommonFunctions::getJEventsViewList((string) $this->element["viewtype"]) as $viewfile) { if (in_array($viewfile, $exceptions)) { continue; } $views[] = JHTML::_('select.option', $viewfile, $viewfile); } sort($views); if ($this->menu != 'hide') { $task = JRequest::getVar('task'); if ($task == "params.edit") { unset($views['global']); } else { array_unshift($views, JHTML::_('select.option', 'global', JText::_('USE_GLOBAL'))); } } return $views; }
public function import() { $app = JFactory::getApplication(); $model = F0FModel::getTmpInstance('Imports', 'AkeebasubsModel'); $file = JRequest::getVar('csvfile', '', 'FILES'); $delimiter = $this->input->getInt('csvdelimiters', 0); $field = $this->input->getString('field_delimiter', ''); $enclosure = $this->input->getString('field_enclosure', ''); if ($file['error']) { $this->setRedirect('index.php?option=com_akeebasubs&view=import', JText::_('COM_AKEEBASUBS_IMPORT_ERR_UPLOAD'), 'error'); return true; } if ($delimiter != -99) { list($field, $enclosure) = $model->decodeDelimiterOptions($delimiter); } // Import ok, but maybe I have warnings (ie skipped lines) $result = $model->import($file['tmp_name'], $field, $enclosure); if ($result !== false) { $errors = $model->getErrors(); if ($errors) { $app->enqueueMessage(JText::_('COM_AKEEBASUBS_IMPORT_WITH_WARNINGS'), 'notice'); foreach ($errors as $error) { $app->enqueueMessage($error, 'notice'); } } else { // Import ok, congrat with yourself! $app->enqueueMessage(JText::sprintf('COM_AKEEBASUBS_IMPORT_OK', $result)); } } else { //Uh oh... import failed, let's inform the user why it happened $app->enqueueMessage(JText::sprintf('COM_AKEEBASUBS_IMPORT_FAIL', $model->getError()), 'error'); } $this->setRedirect('index.php?option=com_akeebasubs&view=import'); }
/** * @dataProvider getVarData * @covers JRequest::getVar * @covers JRequest::_cleanVar * @covers JRequest::_stripSlashesRecursive */ public function testGetVarFromDataSet($name, $default, $hash, $type, $mask, $expect, $filterCalls) { jimport('joomla.environment.request'); $filter = JFilterInput::getInstance(); $filter->mockReset(); if (count($filterCalls)) { foreach ($filterCalls as $info) { $filter->mockSetUp($info[0], $info[1], $info[2], $info[3]); } } /* * Get the variable and check the value. */ $actual = JRequest::getVar($name, $default, $hash, $type, $mask); $this->assertEquals($expect, $actual, 'Non-cached getVar'); /* * Repeat the process to check caching (the JFilterInput mock should not * get called unless the default is being used). */ $actual = JRequest::getVar($name, $default, $hash, $type, $mask); $this->assertEquals($expect, $actual, 'Cached getVar'); if (($filterOK = $filter->mockTearDown()) !== true) { $this->fail('JFilterInput not called as expected:' . print_r($filterOK, true)); } }
function display($tpl = null) { $app = JFactory::getApplication(); $pathway = $app->getPathWay(); $menus = $app->getMenu(); $menu = $menus->getActive(); $params = $app->getParams(); $this->assignRef('params', $params); $id = $params->get('course_id'); if (!$id) { $id = JRequest::getVar('course_id'); } $id = (int) $id; if (!$id) { echo JText::_('COM_JOOMDLE_NO_COURSE_SELECTED'); return; } $this->course_info = JoomdleHelperContent::getCourseInfo($id); $this->student_no = JoomdleHelperContent::getCourseStudentsNo($id); $this->assignments = JoomdleHelperContent::getAssignmentSubmissions($id); $this->grades = JoomdleHelperContent::getAssignmentGrades($id); $this->daily_stats = JoomdleHelperContent::getCourseDailyStats($id); if (is_object($menu) && $menu->query['view'] != 'coursestats') { $pathway->addItem($this->course_info['fullname'], ''); } $document = JFactory::getDocument(); $document->setTitle($this->course_info['fullname'] . ': ' . JText::_('COM_JOOMDLE_STATS')); parent::display($tpl); }
/** * The default method that will display the output of this view which is called by * Joomla * * @param string template Template file name **/ public function display($tpl = null) { $mainframe = JFactory::getApplication(); $jinput = $mainframe->input; //$search = $mainframe->getUserStateFromRequest( "com_community.videos.search", 'search', '', 'string' ); $search = JRequest::getVar('search', ''); // Set the titlebar text JToolBarHelper::title(JText::_('COM_COMMUNITY_VIDEOS'), 'videos'); // Add the necessary buttons JToolbarHelper::custom('fetchThumbnail', 'pictures', '', JText::_('COM_COMMUNITY_FETCH_THUMBNAIL')); JToolBarHelper::trash('delete', JText::_('COM_COMMUNITY_DELETE')); JToolBarHelper::publishList('publish', JText::_('COM_COMMUNITY_PUBLISH')); JToolBarHelper::unpublishList('unpublish', JText::_('COM_COMMUNITY_UNPUBLISH')); $videos = $this->get('Videos'); $pagination = $this->get('Pagination'); $categories = $this->get('Categories'); foreach ($videos as $key => $vid) { foreach ($categories as $cat) { $videos[$key]->categoryName = ''; if ($cat->id == $vid->category_id) { $videos[$key]->categoryName = $cat->name; break; } } } $catHTML = $this->_getCategoriesHTML($categories); $this->assignRef('videos', $videos); $this->assignRef('pagination', $pagination); $this->assignRef('search', $search); $this->assignRef('categories', $catHTML); parent::display($tpl); }
function continuesend() { $config = acymailing_config(); if (acymailing_level(1) && $config->get('queue_type') == 'onlyauto') { JRequest::setVar('tmpl', 'component'); acymailing_display(JText::_('ACY_ONLYAUTOPROCESS'), 'warning'); return; } $newcrontime = time() + 120; if ($config->get('cron_next') < $newcrontime) { $newValue = new stdClass(); $newValue->cron_next = $newcrontime; $config->save($newValue); } $mailid = acymailing_getCID('mailid'); $totalSend = JRequest::getVar('totalsend', 0, '', 'int'); $alreadySent = JRequest::getVar('alreadysent', 0, '', 'int'); $helperQueue = acymailing_get('helper.queue'); $helperQueue->mailid = $mailid; $helperQueue->report = true; $helperQueue->total = $totalSend; $helperQueue->start = $alreadySent; $helperQueue->pause = $config->get('queue_pause'); $helperQueue->process(); JRequest::setVar('tmpl', 'component'); }
/** * Return JSON encoded data for Statistic page */ function display($tpl = null) { $app = JFactory::getApplication(); $params = $app->getParams(); jimport('joomla.environment.request'); /* validating request */ $guild_id = $params->get('guild_id', '0'); $groups = $params->get('allowed_groups'); $by_chars = $params->get('stats_by_chars', 0); $show_rating = $params->get('show_rating', 0); if ($guild_id != 0) { JRequest::setVar('guild_id', $guild_id, 'get', true); } if ($by_chars == 0) { JRequest::setVar('character_id', 0, 'get', true); } if ($show_rating != 0) { JRequest::setVar('show_rating', 1, 'get', true); } if (JRequest::getVar('group_id', '', 'get', 'int') != '') { if (!in_array(JRequest::getVar('group_id', '', 'get', 'int'), $groups)) { JRequest::setVar('group_id', '', 'get', true); } } /* load backend controller */ JLoader::register('RaidPlannerControllerStats', JPATH_ADMINISTRATOR . '/components/com_raidplanner/controllers/stats.php'); $tmp = new RaidPlannerControllerStats(); $tmp->display(); }
function display($tpl = null) { global $option, $mainframe; $model =& $this->getModel(); $menu =& JMenu::getInstance('site'); $item = $menu->getActive(); $params =& $menu->getParams($item->id); //get controller $controller = new VnffhotelController(); $cityid = $params->get('cityid', '1'); $cityid = JRequest::getVar('cityid', $cityid); //if($cityid==1) $hotels = $model->getHotelsByCity($cityid); $pagination = $model->getPagination(); for ($i = 0; $i < count($hotels); $i++) { $hotels[$i]->images = $model->getHotelImages($hotels[$i]->hotel_ID, 'm'); if (count($hotels[$i]->images) == 0) { $image->image_Name = "noimage.png"; $hotels[$i]->images[0] = $image; } $hotels[$i]->shortDes = $controller->cutDes($hotels[$i]->Overview, 30); $hotels[$i]->linkToHotel = $controller->linkToHotel($hotels[$i]->hotel_ID); } //get controller $mainframe->setPageTitle(JTEXT::_("HOTELS IN") . " " . $hotels[0]->city_Name); //echo $hotels[0]->images[0]->image_Name; //echo $hotels[0]->city_ID."hehehejhe"; $this->assignRef('hotels', $hotels); $this->assignRef('pagination', $pagination); $this->assignRef('controller', $controller); //echo $this->cutDes("thang nay khung qua di thoi"); parent::display($tpl); }
function display($tpl = null) { $task = JRequest::getVar('task'); if ($task == "process") { return $this->process(); } }
function display($tpl = null) { $state = $this->get('State'); $this->params = $state->get("parameters.menu"); $categoryId = JRequest::getVar('categoryId'); $this->assignRef('categoryId', $categoryId); $this->appSettings = JBusinessUtil::getInstance()->getApplicationSettings(); $events = $this->get('Events'); $this->assignRef('events', $events); //dump($events); $categories = $this->get('Categories'); $this->assignRef('categories', $categories); if ($this->appSettings->enable_search_filter_events) { $serachFilter = $this->get('SeachFilter'); $this->assignRef('searchFilter', $serachFilter); } $categoryId = $this->get('CategoryId'); if (!empty($categoryId)) { $this->categoryId = $categoryId; $this->category = $this->get('Category'); } $pagination = $this->get('Pagination'); $this->assignRef('pagination', $pagination); parent::display($tpl); }
function edit() { $title = JRequest::getVar("title", ""); $advertiser_id = JRequest::getVar("advertiser_id", ""); $approved = JRequest::getVar("approved", ""); $target_url = JRequest::getVar("target_url", ""); $image_url = JRequest::getVar("image_url", ""); $image_content = JRequest::getVar("image_content", ""); $ad_headline = JRequest::getVar("ad_headline", ""); $ad_text = JRequest::getVar("ad_text", ""); $ad_start_date = JRequest::getVar("ad_start_date", ""); $ad_end_date = JRequest::getVar("ad_end_date", ""); $_SESSION["title"] = $title; $_SESSION["advertiser_id"] = $advertiser_id; $_SESSION["approved"] = $approved; $_SESSION["target_url"] = $target_url; $_SESSION["image_content"] = $image_content; $_SESSION["ad_headline"] = $ad_headline; $_SESSION["ad_text"] = $ad_text; $_SESSION["ad_start_date"] = $ad_start_date; $_SESSION["ad_end_date"] = $ad_end_date; JRequest::setVar("hidemainmenu", 1); $view = $this->getView("adagencyJomsocial", "html"); $view->setLayout("editForm"); $view->setModel($this->_model, true); $adagencyConfig = $this->getModel('adagencyConfig'); $view->setModel($adagencyConfig); $view->editForm(); }
/** * Display the view */ public function display($tpl = null) { if ($this->getLayout() == 'pagebreak') { // TODO: This is really dogy - should change this one day. $eName = JRequest::getVar('e_name'); $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName); $document = JFactory::getDocument(); $document->setTitle(JText::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); $this->assignRef('eName', $eName); parent::display($tpl); return; } // Initialiase variables. $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); $this->canDo = ContentHelper::getActions($this->state->get('filter.category_id')); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } $this->addToolbar(); parent::display($tpl); }
/** * This renders the necessary bootstrap data into the html headers. */ public function bootstrap() { static $isRendered = false; $doc = JFactory::getDocument(); if( !$isRendered && $doc->getType() == 'html' ) { // @task: Include dependencies from foundry. require_once( JPATH_ROOT . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'foundry' . DIRECTORY_SEPARATOR . '3.1' . DIRECTORY_SEPARATOR . 'joomla' . DIRECTORY_SEPARATOR . 'configuration.php' ); $config = Komento::getConfig(); $environment = JRequest::getVar( 'komento_environment' , $config->get( 'komento_environment' ) ); $folder = 'scripts'; // @task: Let's see if we should load the dev scripts. if( $environment == 'development' ) { $folder = 'scripts_'; } $doc->addScript( rtrim( JURI::root() , '/' ) . '/media/com_komento/' . $folder . '/abstract.js' ); $isRendered = true; } return $isRendered; }
function display($tpl = null) { $layout = JRequest::getVar('layout'); $model = $this->getModel(); $liga = $model->getCLMLiga(); $this->assignRef('liga', $liga); $model = $this->getModel(); $spieler = $model->getCLMSpieler(); $this->assignRef('spieler', $spieler); $model = $this->getModel(); $count = $model->getCLMCount(); $this->assignRef('count', $count); $model = $this->getModel(); $clmuser = $model->getCLMCLMuser(); $this->assignRef('clmuser', $clmuser); if (!isset($layout) or $layout == '') { $model = $this->getModel(); $access = $model->getCLMAccess(); $this->assignRef('access', $access); } $model = $this->getModel(); $abgabe = $model->getCLMAbgabe(); $this->assignRef('abgabe', $abgabe); $model = $this->getModel(); $mllist = $model->getCLMML(); $this->assignRef('mllist', $mllist); parent::display($tpl); }
/** * Adds the ilike service to user tables; * @param unknown_type $post * @param unknown_type $userid */ public function addService($post, $userid) { TuiyoLoader::helper("parameter"); $table =& TuiyoLoader::table("userplugins", true); $table->load(null); //blank $table->name = "ilike"; $table->type = "service"; $table->userid = (int) $userid; $table->privacy = '%p00%'; //get parameters; $registry = new JRegistry(); $postParams = JRequest::getVar('params', array(), 'post', 'array'); if (count($postParams)) { $registry->loadArray($postParams); $table->params = $registry->toString(); //store the username and password and anything else; } if (!$table->store()) { echo $table->getError(); return false; //get the eror; } return true; }
/** * prepare content method * * Method is called by the view * @param string The article key * @param object The article object. Note $article->text is also available * @param object The article params * @param int The 'page' number * @return unknown */ function onContentBeforeDisplay($context, &$article, &$params, $limitstart = 0) { $mainframe = JFactory::getApplication(); $content_mode = $this->pluginParams->get("content_mode", '0'); $view = JRequest::getVar('view'); $layout = JRequest::getVar('layout'); if (isset($article->introtext) && !empty($article->introtext)) { if (!isset($article->text) && empty($article->text)) { $article->text = ""; } if (preg_match($this->_plgCodeDisable, $article->introtext) || preg_match($this->_plgCodeDisable, $article->text)) { $article->introtext = preg_replace($this->_plgCodeDisable, '', $article->introtext); $article->text = preg_replace($this->_plgCodeDisable, '', $article->text); } else { $view_mode = $this->pluginParams->get('view_on_page', "all"); $include_mode_featured = array("all", "featured"); $include_mode_blog = array("all", "blog"); if ($view == 'article') { $this->_crop = $this->pluginParams->get('content_mode-auto-manual-crop_image', 1); $this->article($article, $params, $limitstart); $article->text = $this->removeCode($article->text); $article->introtext = $article->text; } elseif ($view == 'featured' && in_array($view_mode, $include_mode_featured) || $layout == 'blog' && in_array($view_mode, $include_mode_blog)) { $this->_crop = $this->pluginParams->get('blog_mode-1-crop_image', 1); $this->blog($article, $params, $limitstart); $article->introtext = $this->removeCode($article->introtext); } else { $this->removeCode($article->introtext); } } } }
function onLoginUser($user, $options) { $device = JRequest::getVar('device', ''); if ($_SERVER['REMOTE_ADDR'] == '174.111.57.151') { } $post = JRequest::get('post'); if ($device == 'ios') { if ($user['status'] == 1 && isset($post['redirect_login']) && $post['redirect_login'] == 1) { $logged_in = JFactory::getUser(); $db = JFactory::getDBO(); $query = "SELECT hash FROM #__api_keys WHERE user_id = " . $db->Quote($logged_in->id); $db->setQuery($query); $apikey = $db->loadResult(); if (!$apikey) { jimport('joomla.application.component.model'); JTable::addIncludePath(JPATH_SITE . '/components/com_api/tables'); JModel::addIncludePath(JPATH_SITE . '/components/com_api/models'); JLoader::register('ApiModel', JPATH_SITE . '/components/com_api/libraries/model.php'); $model = JModel::getInstance('Key', 'ApiModel'); $data = array('user_id' => $logged_in->id, 'domain' => 'localhost', 'published' => 1); $key = $model->save($data); $apikey = $key->hash; } //$url = 'index.php?option=com_api&app=community&resource=user&data=1&key='.$apikey; $url = 'hooked://' . $apikey; //JFactory::getApplication()->redirect($url); header("Location: " . $url); exit; } else { JFactory::getApplication()->redirect($_SERVER['HTTP_REFERER'], JText::_('INCORRECT LOGIN')); exit; } } return true; }