function display($tpl = null)
    {
        // Assign data to the view
        $this->events = $this->get('Events');
        $this->protocolReminders = $this->get('ProtocolReminders');
        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseError(500, implode('<br />', $errors));
            return false;
        }
        $document = JFactory::getDocument();
        $this->mapJS($document);
        $totalEvents = $this->get('NumEvents');
        $apiParams = json_encode($this->get('ApiParams'));
        $userID = Jfactory::getUser()->id;
        $canRecordAttendance = SWG_EventsController::canRecordAttendance() ? 'true' : 'false';
        $document->addScript('/components/com_swg_events/views/eventlisting/script/eventlisting.js');
        $document->addScriptDeclaration(<<<MAP
window.addEvent('domready', function()
{
\tregisterMapLinks();
\tdocument.addEvent("scroll",scrolled);
\ttotalEvents = {$totalEvents};
\tapiParams = {$apiParams};
\tcanRecordAttendance = {$canRecordAttendance};
\tuserID = {$userID};
});
MAP
);
        // Display the view
        parent::display($tpl);
    }
Exemplo n.º 2
0
 /**
  * save the posted form data.
  *
  */
 function save()
 {
     $mainframe = Jfactory::getApplication();
     $model = $this->getModel('redform');
     $result = $model->apisaveform();
     $referer = JRequest::getVar('referer');
     if (!$result) {
         if (!JRequest::getBool('ALREADY_ENTERED')) {
             $msg = JText::_('COM_REDFORM_Sorry_there_was_a_problem_with_your_submission') . ': ' . $model->getError();
         }
         $this->setRedirect($referer, $msg, 'error');
         $this->redirect();
     }
     if ($url = $model->hasActivePayment($result->submit_key)) {
         $url = 'index.php?option=com_redform&controller=payment&task=select&key=' . $result->submit_key;
         $this->setRedirect($url);
         $this->redirect();
     }
     if ($url = $model->getRedirect()) {
         $this->setRedirect($url);
         $this->redirect();
     } else {
         echo $model->getNotificationText();
     }
 }
Exemplo n.º 3
0
 public function __construct($id = null)
 {
     if ($id) {
         $this->setId($id);
     }
     $this->_db = Jfactory::getDbo();
 }
Exemplo n.º 4
0
 function save(&$element, $forceBackend = false)
 {
     $app = Jfactory::getApplication();
     if ($app->isAdmin() || $forceBackend) {
         return $this->saveBackend($element);
     }
     return $this->saveFrontend($element);
 }
Exemplo n.º 5
0
 public function __construct()
 {
     $this->_table_prefix = '#__' . TABLE_PREFIX . '_';
     $this->_db = Jfactory::getDBO();
     $this->_session = JFactory::getSession();
     $this->_order_functions = new order_functions();
     $this->_extra_field = new extra_field();
     $this->_extraFieldFront = new extraField();
     $this->_redhelper = new redhelper();
     $this->_producthelper = new producthelper();
     $this->_shippinghelper = new shipping();
 }
Exemplo n.º 6
0
 /**
 * Example Search method
 *
 * The sql must return the following fields that are used in a common display
 * routine:
 - title;
 - href:            link associated with the title;
 - browsernav    if 1, link opens in a new window, otherwise in the same window;
 - section        in parenthesis below the title;
 - text;
 - created;
 
 * @param string Target search string
 * @param string matching option, exact|any|all
 * @param string ordering option, newest|oldest|popular|alpha|category
 * @param mixed An array if the search it to be restricted to areas, null if search all
 *
 * @return array Search results
 */
 public function onContentSearch($text, $phrase = '', $ordering = '', $areas = null)
 {
     $result = array();
     // jelenleg semmilyen paramétert nem veszek figyelembe és hozzáférés ellenörzés sincs.
     $db = Jfactory::getDBO();
     // témakorok
     $db->setQuery('select t.megnevezes as title,
       t.id,
       "2" as browsernav,
       "' . JText::_('TEMAKOROK') . '" as section,
       "" as `text`,
       t.letrehozva as created
       from #__temakorok t
       where t.megnevezes like "%' . $text . '%"
       order by t.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_szavazasok&view=szavazasoklist&temakor=' . $res1->id;
         $result[] = $res1;
     }
     // szavazások
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('SZAVAZASOK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz
       where  sz.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     // alternativák
     $db->setQuery('select sz.megnevezes as title,
       sz.id,
       "2" as browsernav,
       "' . JText::_('ALTERNATIVAK') . '" as section,
       "" as `text`,
       sz.letrehozva as created
       from #__szavazasok sz, #__alternativak a
       where  a.szavazas_id = sz.id and a.megnevezes like "%' . $text . '%"
       order by sz.id DESC');
     $res = $db->loadObjectList();
     foreach ($res as $res1) {
         $res1->href = 'index.php?option=com_alternativak&view=alternativaklist&szavazas=' . $res1->id;
         $result[] = $res1;
     }
     return $result;
 }
 public function __construct($params)
 {
     $this->_params = $params;
     $this->_db = Jfactory::getDBO();
     if (JRequest::getCmd('option') == 'com_joomleague') {
         $p = JRequest::getInt('p', $params->get('default_project_id'));
     } else {
         $p = $params->get('default_project_id');
     }
     $this->_project_id = intval($p);
     $this->_project = $this->getProject();
     $this->_round_id = JRequest::getInt('r');
     $this->_division_id = JRequest::getInt('division', 0);
     $this->_team_id = JRequest::getInt('tid', 0);
 }
Exemplo n.º 8
0
 /**
  * Function to return event access (access levels, approval and event access status)
  *
  * @access	public static
  * @param	$id - id of the event
  * @return	list array of access levels, approval and event access status
  *
  * @since	3.4.0
  */
 public static function eventAccess($id = null)
 {
     // Preparing connection to db
     $db = Jfactory::getDbo();
     // Preparing the query
     $query = $db->getQuery(true);
     $query->select('e.state AS evtState, e.approval AS evtApproval, e.access AS evtAccess')->from($db->qn('#__icagenda_events') . ' AS e')->where($db->qn('e.id') . ' = ' . $db->q($id));
     $query->select('v.title AS accessName')->join('LEFT', $db->quoteName('#__viewlevels') . ' AS v ON v.id = e.access');
     $db->setQuery($query);
     $eventAccess = $db->loadObject();
     if ($eventAccess) {
         return $eventAccess;
     } else {
         return false;
     }
 }
Exemplo n.º 9
0
 /**
  * Retrieve the Twitter connection details for the current user
  * @return array
  */
 function _lookupUserLogin()
 {
     global $mainframe;
     $user =& Jfactory::getUser();
     if ($user->id) {
         // make sure there is a logged in user
         $btuser =& JTable::getInstance('btuser');
         $data = $this->getUser($user->id);
         $key = str_rot13(strrev($user->username));
         $crypt = new JSimpleCrypt($key);
         $password = $crypt->decrypt($data->password);
         return array('username' => $data->username, 'password' => $password);
     } else {
         return array('username' => '', 'password' => '');
     }
 }
Exemplo n.º 10
0
 /**
  * Returns a reference to the global User object, only creating it if it
  * doesn't already exist.
  *
  * This method must be invoked as:
  * 		<pre>  $user =& JUser::getInstance($id);</pre>
  *
  * @access 	public
  * @param 	int 	$id 	The user to load - Can be an integer or string - If string, it is converted to ID automatically.
  * @return 	JUser  			The User object.
  * @since 	1.5
  */
 function &getInstance($id = 0)
 {
     static $instances;
     if (!isset($instances)) {
         $instances = array();
     }
     // Find the user id
     if (!$id) {
         $user =& Jfactory::getUser();
         $id = $user->get('id');
     }
     if (empty($instances[$id])) {
         $inst = new UserAcl($id);
         $instances[$id] = $inst;
     }
     return $instances[$id];
 }
Exemplo n.º 11
0
 function makeDefault()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('shoppergroup', 'html');
     $model = VmModel::getModel('shoppergroup');
     $msgtype = '';
     $cids = JRequest::getVar('virtuemart_shoppergroup_id', array());
     if ($model->makeDefault((int) $cids[0])) {
         $msg = JText::_('COM_VIRTUEMART_SET_TO_DEFAULT_SUCCESSFULLY');
     } else {
         $msg = '';
         // 			$msg = JText::_('COM_VIRTUEMART_SET_TO_DEFAULT_ERROR');
         $msgtype = 'error';
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=shoppergroup', $msg, $msgtype);
 }
Exemplo n.º 12
0
 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = 100000;
     $limitstart = $state->limitstart;
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
Exemplo n.º 13
0
 /**
  * Clone a product
  *
  * @author Max Milbers
  */
 public function createClone()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('custom', 'html');
     $model = tmsModel::getModel('custom');
     $msgtype = '';
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('tsmart_custom_id'));
     foreach ($cids as $custom_id) {
         if ($model->createClone($custom_id)) {
             $msg = tsmText::_('com_tsmart_CUSTOM_CLONED_SUCCESSFULLY');
         } else {
             $msg = tsmText::_('com_tsmart_CUSTOM_NOT_CLONED_SUCCESSFULLY') . ' : ' . $custom_id;
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_tsmart&view=custom', $msg, $msgtype);
 }
/**
 * make sure the version table has the proper structure (1.0 import !)
 * if not, update it
 */
function _checkVersionTable()
{
    $db = Jfactory::getDBO();
    $res = $db->getTableFields('#__joomleague_version');
    $cols = array_keys(reset($res));
    if (!in_array('major', $cols)) {
        $query = ' ALTER TABLE #__joomleague_version ADD `major` INT NOT NULL ,
				ADD `minor` INT NOT NULL ,
				ADD `build` INT NOT NULL ,
				ADD `count` INT NOT NULL ,
				ADD `revision` VARCHAR(128) NOT NULL ,
				ADD `file` VARCHAR(255) NOT NULL';
        $db->setQuery($query);
        if (!$db->query()) {
            echo JText::_('Failed updating version table');
        }
    }
}
Exemplo n.º 15
0
 /**
  * rekord sorozat beolvasása az adatbázisból
  * @JRequest filter, order, limit, limitstart
  * @return array of records
  */
 public function getItems($state)
 {
     $db = Jfactory::getDBO();
     $query = $this->getListQuery($state);
     $limit = JRequest::getvar('limit', 20);
     $limitstart = JRequest::getvar('limitstart', 0);
     if ($limit == '') {
         $limit = 20;
     }
     if ($limit == 0) {
         $limit = 20;
     }
     if ($limitstart == '') {
         $limitstart = 0;
     }
     $db->setQuery($query, $limitstart, $limit);
     return $db->loadObjectList();
 }
Exemplo n.º 16
0
 /**
  * Clone a shipment
  *
  * @author Valérie Isaksen
  */
 public function CloneShipment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('shipmentmethod', 'html');
     $model = VmModel::getModel('shipmentmethod');
     $msgtype = '';
     $cids = vRequest::getVar($this->_cidName, vRequest::getInt('virtuemart_shipment_id'));
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = vmText::_('COM_VIRTUEMART_SHIPMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=shipmentmethod', $msg, $msgtype);
 }
Exemplo n.º 17
0
 /**
  */
 protected function populateState($ordering = null, $direction = null)
 {
     // Initiilise variables
     $app = Jfactory::getApplication('administrator');
     //load the filter state
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setstate('filter.search', $search);
     $accessId = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', null, 'int');
     $this->setstate('filter.access', $accessId);
     $published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_published', '', 'string');
     $this->setstate('filter.state', $published);
     $categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id', '');
     $this->setstate('filter.category_id', $categoryId);
     //Load the parameters
     $params = JComponentHelper::getParams('com_battle');
     $this->setState('params', $params);
     //List state information
     //	parent::populateState ('a.name','asc');
 }
Exemplo n.º 18
0
 /**
  * Clone a product
  *
  * @author RolandD, Max Milbers
  */
 public function createClone()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('custom', 'html');
     $model = VmModel::getModel('custom');
     $msgtype = '';
     $cids = JRequest::getVar($this->_cidName, JRequest::getVar('virtuemart_custom_id', array(), '', 'ARRAY'), '', 'ARRAY');
     jimport('joomla.utilities.arrayhelper');
     JArrayHelper::toInteger($cids);
     foreach ($cids as $custom_id) {
         if ($model->createClone($custom_id)) {
             $msg = JText::_('COM_VIRTUEMART_CUSTOM_CLONED_SUCCESSFULLY');
         } else {
             $msg = JText::_('COM_VIRTUEMART_CUSTOM_NOT_CLONED_SUCCESSFULLY') . ' : ' . $custom_id;
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=custom', $msg, $msgtype);
 }
Exemplo n.º 19
0
 /**
  * Post-flight extension installer method.
  *
  * This method runs after all other installation code.
  *
  * @param	$type
  * @param	$parent
  *
  * @return	void
  * @since	1.0.3
  */
 function postflight($type, $parent)
 {
     // Display a move files and folders to parent.
     jimport('joomla.filesystem.folder');
     $srcBase = JPATH_PLUGINS . '/editors/arkeditor/layouts/joomla/';
     $dstBase = JPATH_SITE . '/layouts/joomla/';
     $folders = JFolder::folders($srcBase);
     $manifest = $parent->getParent()->getManifest();
     $attributes = $manifest->attributes();
     $method = $attributes->method ? (string) $attributes->method : false;
     foreach ($folders as $folder) {
         if ($method != 'upgrade') {
             if (JFolder::exists($dstBase . $folder)) {
                 JFolder::delete($dstBase . $folder);
             }
         }
         JFolder::copy($srcBase . $folder, $dstBase . $folder, null, true);
     }
     if ($type == 'install') {
         //update $db
         $db = Jfactory::getDBO();
         $toolbars = base64_encode('{"back":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord" ] ,["SelectAll","SpellChecker", "Scayt" ] ,["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat" ] ,[ "NumberedList","BulletedList","Outdent","Indent","-","Blockquote","CreateDiv","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock","BidiLtr","BidiRtl" ],[ "Link","Document","Unlink","Anchor" ],	[ "Image","Flash","Table","Smiley","SpecialChar","PageBreak","Iframe" ],[ "Styles","Format","Font","FontSize" ],[ "TextColor","BGColor" ],[ "Maximize", "ShowBlocks","-","About" ]],"front":[[ "Templates" ],[ "Cut","Copy","Paste","PasteText","PasteFromWord"] ,["Bold","Italic","Underline","Strike","RemoveFormat" ],  [ "NumberedList","BulletedList","Outdent","Indent","Blockquote"],[ "Link","Document","Unlink","Anchor" ],[ "Image","Table","SpecialChar","PageBreak","Iframe"],["Styles","Format" ],[ "Maximize", "ShowBlocks","About" ]],"inline" :[["Sourcedialog","Bold","NumberedList","BulletedList"],["PasteText","Image","Link","Document"],["Format"],["Readmore"],["Save"],["Versions"],["Close"] ],"title":[["Save"],["Cut","Copy","PasteText"],["Undo"],["Close"]],"image":[["Save"],["Image"],["Link","Document"],["Close"]],"mobile":[["Bold"],["Link"],["Image"],["Save"],["Versions"],["Close"]]}');
         $query = $db->getQuery(true);
         $query->select('params')->from('#__extensions')->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         $params = $db->loadResult();
         if ($params === false) {
             throw new Exception('Failed to retrieve parameters from Editor');
         }
         if (!$params) {
             $params = '{}';
         }
         $params = new JRegistry($params);
         $params->set('toolbars', $toolbars);
         $query->clear()->update('#__extensions')->set('params= ' . $db->quote($params->toString()))->where('folder = ' . $db->quote('editors'))->where('element = ' . $db->quote('arkeditor'));
         $db->setQuery($query);
         if (!$db->query()) {
             throw new Exception('Failed to update parameters for Editor');
         }
     }
 }
Exemplo n.º 20
0
 /**
  * Clone a payment
  *
  * @author Valérie Isaksen
  */
 public function ClonePayment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('paymentmethod', 'html');
     $model = VmModel::getModel('paymentmethod');
     $msgtype = '';
     //$cids = vRequest::getInt('virtuemart_product_id',0);
     $cids = vRequest::getVar($this->_cidName, vRequest::getVar('virtuemart_payment_id'));
     //jimport( 'joomla.utilities.arrayhelper' );
     JArrayHelper::toInteger($cids);
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = vmText::_('COM_VIRTUEMART_PAYMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = vmText::_('COM_VIRTUEMART_PAYMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_virtuemart&view=paymentmethod', $msg, $msgtype);
 }
Exemplo n.º 21
0
 /**
  * Clone a payment
  *
  * @author Valérie Isaksen
  */
 public function ClonePayment()
 {
     $mainframe = Jfactory::getApplication();
     /* Load the view object */
     $view = $this->getView('paymentmethod', 'html');
     $model = tmsModel::getModel('paymentmethod');
     $msgtype = '';
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('tsmart_payment_id'));
     if (!is_array($cids)) {
         $cids = array($cids);
     }
     foreach ($cids as $cid) {
         if ($model->createClone($cid)) {
             $msg = tsmText::_('com_tsmart_PAYMENT_CLONED_SUCCESSFULLY');
         } else {
             $msg = tsmText::_('com_tsmart_PAYMENT_NOT_CLONED_SUCCESSFULLY');
             $msgtype = 'error';
         }
     }
     $mainframe->redirect('index.php?option=com_tsmart&view=paymentmethod', $msg, $msgtype);
 }
Exemplo n.º 22
0
 /**
  * Creates the output for the registration view
  *
  * @since 1.5
  */
 function display($tpl = null)
 {
     $mainframe =& Jfactory::getApplication();
     $document =& JFactory::getDocument();
     $user =& JFactory::getUser();
     $dispatcher =& JDispatcher::getInstance();
     $config = redEVENTHelper::config();
     $acl = UserAcl::getInstance();
     $event = $this->get('SessionDetails');
     if ($this->getLayout() == 'confirmed') {
         $message = $event->confirmation_message;
         $document->setTitle($event->title . ' - ' . JText::_('COM_REDEVENT_REGISTRATION_CONFIRMED_PAGE_TITLE'));
     } else {
         if ($this->getLayout() == 'review') {
             $message = $event->review_message;
             $document->setTitle($event->title . ' - ' . JText::_('COM_REDEVENT_REGISTRATION_REVIEW_PAGE_TITLE'));
         } else {
             if ($this->getLayout() == 'edit') {
                 return $this->_displayEdit($tpl);
             } else {
                 if ($this->getLayout() == 'cancel') {
                     return $this->_displayCancel($tpl);
                 } else {
                     echo 'layout not defined';
                     return;
                 }
             }
         }
     }
     /* This loads the tags replacer */
     JView::loadHelper('tags');
     /* Start the tag replacer */
     $tags = new redEVENT_tags();
     $tags->setXref(JRequest::getInt('xref'));
     $message = $tags->ReplaceTags($message);
     $this->assignRef('tags', $tags);
     $this->assignRef('message', $message);
     $this->assignRef('event', $event);
     parent::display($tpl);
 }
Exemplo n.º 23
0
 public function __construct($params)
 {
     $this->_params = $params;
     $this->_db = Jfactory::getDBO();
     //		$this->_division_id   	= JRequest::getVar('jlamdivisionid',0,'default','POST');
     /*
     if (JRequest::getCmd('option') == 'com_joomleague') {
     	$p = JRequest::getInt('p', $params->get('default_project_id'));
     }
     else {
     	$p = $params->get('default_project_id');
     }
     */
     //$this->_project_id 		= intval($p);
     /*
     $this->_project_id 		= JRequest::getInt('p');
     $this->_project 		= $this->getProject();
     $this->_round_id   		= JRequest::getInt('r');
     $this->_division_id   	= JRequest::getInt('division',0);
     $this->_team_id   		= JRequest::getInt('tid',0);
     */
     /*
         echo 'project int -> <pre>'.print_r(JRequest::getInt('p'),true).'</pre><br>';
     echo 'project var -> <pre>'.print_r(JRequest::getVar('p'),true).'</pre><br>';
     echo 'project view -> <pre>'.print_r(JRequest::getVar('view'),true).'</pre><br>';
     echo 'project tid -> <pre>'.print_r(JRequest::getVar('tid'),true).'</pre><br>';	
     
     echo 'get -> <pre>'.print_r($_GET,true).'</pre><br>';	
     echo 'post -> <pre>'.print_r($_POST,true).'</pre><br>';	
     echo 'request -> <pre>'.print_r($_REQUEST,true).'</pre><br>';
     */
     if ($this->_project_id) {
         JRequest::setVar('jlamseason', $this->getSeasonId());
         JRequest::setVar('jlamleague', $this->getLeagueId());
         JRequest::setVar('jlamproject', $this->_project_id);
         JRequest::setVar('jlamdivisionid', $this->_division_id);
     }
 }
Exemplo n.º 24
0
 /**
  * Creates the output
  *
  * @since 0.5
  * @param int $tpl
  */
 function display($tpl = null)
 {
     $params = JComponentHelper::getParams('com_redevent');
     if (!$params->get('enable_moreinfo', 1)) {
         echo Jtext::_('COM_REDEVENT_MOREINFO_ERROR_DISABLED_BY_ADMIN');
         return;
     }
     if ($this->getLayout() == 'final') {
         return $this->_displayFinal($tpl);
     }
     $xref = JRequest::getInt('xref');
     $uri =& JFactory::getUri();
     $document = JFactory::getDocument();
     $user =& Jfactory::getUser();
     if (!$xref) {
         echo JText::_('COM_REDEVENT_MOREINFO_ERROR_MISSING_XREF');
     }
     $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/moreinfo.css');
     $this->assign('xref', $xref);
     $this->assign('action', JRoute::_(RedeventHelperRoute::getMoreInfoRoute($xref)));
     $this->assignRef('user', $user);
     parent::display($tpl);
 }
Exemplo n.º 25
0
 function getProgram()
 {
     $database = Jfactory::getDBO();
     if (empty($this->_attribute)) {
         $this->_attribute = $this->getTable("guruPrograms");
         $this->_attribute->load($this->_id);
     }
     $data = JRequest::get('post');
     if (!$this->_attribute->bind($data)) {
         $this->setError($item->getErrorMsg());
         return false;
     }
     if (!$this->_attribute->check()) {
         $this->setError($item->getErrorMsg());
         return false;
     }
     $sql = "SELECT sum(lt.time) AS course_time \r\n\t\t\t  FROM `#__guru_task` as lt \r\n\t\t\t  LEFT JOIN `#__guru_mediarel` lm on lt.id=lm.media_id \r\n\t\t\t  LEFT JOIN `#__guru_days` as ld on lm.type_id=ld.id\r\n\t\t\t  WHERE type='dtask' and ld.pid=" . $this->_id;
     $database->setQuery($sql);
     $database->query();
     $result = $database->loadResult();
     $hours = intval($result / 60);
     $minutes = $result % 60;
     $this->_attribute->duration = $hours . ":" . $minutes;
     switch ($this->_attribute->level) {
         case "0":
             $this->_attribute->level = JText::_('GURU_LEVEL_BEGINER');
             break;
         case "1":
             $this->_attribute->level = JText::_('GURU_LEVEL_INTERMEDIATE');
             break;
         case "2":
             $this->_attribute->level = JText::_('GURU_LEVEL_ADVANCED');
             break;
     }
     return $this->_attribute;
 }
Exemplo n.º 26
0
 public function CreateOrderHead()
 {
     $mainframe = Jfactory::getApplication();
     $model = VmModel::getModel();
     $orderid = $model->CreateOrderHead();
     $mainframe->redirect('index.php?option=com_virtuemart&view=orders&task=edit&virtuemart_order_id=' . $orderid);
 }
Exemplo n.º 27
0
 /**
  * Do load rulles and start checking function
  */
 public function onAfterRoute()
 {
     $option = JRequest::getCMD('option');
     $adapterLibFile = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_noixacl" . DS . "libraries" . DS . "adapter.php";
     //return false if not exists file
     if (!file_exists($adapterLibFile)) {
         return false;
     }
     if ($option == 'com_installer' || $option == 'com_noixacl') {
         $pathFile = JPATH_ADMINISTRATOR . DS . "components" . DS . "com_noixacl" . DS . "libraries" . DS . 'installer' . DS . 'adapters' . DS . 'adapter.php';
         if (file_exists($pathFile)) {
             require_once $pathFile;
             // Get an installer instance
             $installer =& JInstaller::getInstance();
             $adapterInstaller = new JInstallerAdapter($installer);
             $installer->setAdapter('adapter', $adapterInstaller);
         }
     }
     $db = JFactory::getDBO();
     $app =& JFactory::getApplication();
     $user = Jfactory::getUSER();
     $acl =& JFactory::getACL();
     //if user not logged return false;
     if ($user->id == 0) {
         return false;
     }
     //geting usertype from user
     $arrMultiGroups[] = $user->usertype;
     $arrUserGroupId = array($user->gid);
     //get multigrop names if user have it
     $sqlGetMultigroups = "SELECT grp.name, grp.id FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$user->id}";
     $db->setQuery($sqlGetMultigroups);
     $multiGroups = $db->loadObjectList();
     if (!empty($multiGroups)) {
         foreach ($multiGroups as $mgrp) {
             $arrMultiGroups[] = $mgrp->name;
             $arrUserGroupId[] = $mgrp->id;
         }
     }
     //rrr
     $this->globArrMultiGroups = $arrMultiGroups;
     //get access level
     $groupList = implode(',', $arrUserGroupId);
     $query = "SELECT id_levels FROM #__noixacl_groups_level WHERE id_group IN ({$groupList})";
     $db->setQuery($query);
     $glevels = $db->loadObjectList();
     if (!empty($glevels)) {
         foreach ($glevels as $glevel) {
             $arrUserLevels = explode(',', $glevel->id_levels);
             if (!empty($arrUserLevels)) {
                 foreach ($arrUserLevels as $groupLevel) {
                     if ($groupLevel > $user->get('aid')) {
                         $user->aid = $groupLevel;
                     }
                 }
             }
         }
     }
     //geting rules from multigroups
     //		$acl_sql = "SELECT aco_section,aco_value,aro_section,aro_value,axo_section,axo_value FROM #__noixacl_rules WHERE ACO_VALUE<>'BLOCK' AND aro_section = 'users' AND aro_value IN ('". implode("','",$arrMultiGroups) ."')";
     $acl_sql = "SELECT aco_section,aco_value,aro_section,aro_value,axo_section,axo_value FROM #__noixacl_rules WHERE aro_section = 'users' AND aro_value IN ('" . implode("','", $arrMultiGroups) . "')";
     $db->setQuery($acl_sql);
     $rulles = $db->loadObjectList();
     if (count($rulles) > 0) {
         /**
          * Adding a rule to joomlaACL
          */
         foreach ($rulles as $r) {
             $acl->addACL($r->aco_section, $r->aco_value, $r->aro_section, $user->usertype, $r->axo_section, $r->axo_value);
         }
     }
     $this->controlAdapterAccess();
 }
Exemplo n.º 28
0
 /**
  * Add a product rating
  * @author Max Milbers
  */
 public function addRating()
 {
     $mainframe = Jfactory::getApplication();
     /* Get the product ID */
     // 		$cids = array();
     $cids = JRequest::getVar($this->_cidName, JRequest::getVar('virtuemart_product_id', array(), '', 'ARRAY'), '', 'ARRAY');
     jimport('joomla.utilities.arrayhelper');
     JArrayHelper::toInteger($cids);
     // 		if (!is_array($cids)) $cids = array($cids);
     $mainframe->redirect('index.php?option=com_virtuemart&view=ratings&task=add&virtuemart_product_id=' . $cids[0]);
 }
Exemplo n.º 29
0
 /**
  * Add a product rating
  * @author Max Milbers
  */
 public function addRating()
 {
     $mainframe = Jfactory::getApplication();
     // Get the product ID
     $cids = vRequest::getInt($this->_cidName, vRequest::getInt('virtuemart_product_id'));
     $mainframe->redirect('index.php?option=com_virtuemart&view=ratings&task=add&virtuemart_product_id=' . $cids[0]);
 }
 function _displayPopulate($tpl)
 {
     $app = JFactory::getApplication();
     $document = Jfactory::getDocument();
     $uri = JFactory::getURI();
     $model = $this->getModel();
     $projectws =& $this->get('Data', 'projectws');
     $document->setTitle(JText::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TITLE'));
     $version = urlencode(JoomleagueHelper::getVersion());
     $document->addScript('components/com_joomleague/assets/js/populate.js?v=' . $version);
     $lists = array();
     $options = array(JHTML::_('select.option', 0, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_SINGLE_ROUND_ROBIN')), JHTML::_('select.option', 1, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_DOUBLE_ROUND_ROBIN')), JHTML::_('select.option', 2, Jtext::_('COM_JOOMLEAGUE_ADMIN_ROUNDS_POPULATE_TYPE_TOURNAMENT_ROUND_ROBIN')));
     $lists['scheduling'] = JHTML::_('select.genericlist', $options, 'scheduling', '', 'value', 'text');
     //TODO-add error message - what if there are no teams assigned to the project
     $teams = $this->get('projectteams');
     $options = array();
     foreach ($teams as $t) {
         $options[] = JHTML::_('select.option', $t->projectteam_id, $t->text);
     }
     $lists['teamsorder'] = JHTML::_('select.genericlist', $options, 'teamsorder[]', 'multiple="multiple" size="20"');
     $this->assignRef('projectws', $projectws);
     $this->assignRef('request_url', $uri->toString());
     $this->assignRef('lists', $lists);
     $this->addToolbar_Populate();
     parent::display($tpl);
 }