Example #1
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $project_id = $mainframe->getUserState($option . 'project');
     $uri = JFactory::getURI()->toString();
     $user = JFactory::getUser();
     // Get data from the model
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $model = $this->getModel();
     $projectws = $this->get('Data', 'project');
     $division = $mainframe->getUserStateFromRequest($option . 'tt_division', 'division', '', 'string');
     //build the html options for divisions
     $divisions[] = JHtmlSelect::option('0', JText::_('COM_JOOMLEAGUE_GLOBAL_SELECT_DIVISION'));
     $mdlDivisions = JModelLegacy::getInstance("divisions", "JoomLeagueModel");
     if ($res = $mdlDivisions->getDivisions($project_id)) {
         $divisions = array_merge($divisions, $res);
     }
     $lists['divisions'] = $divisions;
     unset($divisions);
     $this->user = $user;
     $this->lists = $lists;
     $this->items = $items;
     $this->projectws = $projectws;
     $this->division = $division;
     $this->total = $total;
     $this->pagination = $pagination;
     $this->request_url = $uri;
     $this->addToolbar();
     parent::display($tpl);
 }
Example #2
0
 /**
  * Display an edit icon for the article.
  *
  * This icon will not display in a popup window, nor if the article is trashed.
  * Edit access checks must be performed in the calling code.
  *
  * @param	object	$article	The article in question.
  * @param	object	$params		The article parameters
  * @param	array	$attribs	Not used??
  *
  * @return	string	The HTML for the article edit icon.
  * @since	1.6
  */
 static function edit($article, $params, $attribs = array())
 {
     // Initialise variables.
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $uri = JFactory::getURI();
     // Ignore if in a popup window.
     if ($params && $params->get('popup')) {
         return;
     }
     // Ignore if the state is negative (trashed).
     if ($article->state < 0) {
         return;
     }
     JHtml::_('behavior.tooltip');
     $url = 'index.php?task=article.edit&a_id=' . $article->id . '&return=' . base64_encode($uri);
     $icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
     $text = JHTML::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true);
     if ($article->state == 0) {
         $overlib = JText::_('JUNPUBLISHED');
     } else {
         $overlib = JText::_('JPUBLISHED');
     }
     $date = JHTML::_('date', $article->created);
     $author = $article->created_by_alias ? $article->created_by_alias : $article->author;
     $overlib .= '&lt;br /&gt;';
     $overlib .= $date;
     $overlib .= '&lt;br /&gt;';
     $overlib .= JText::sprintf('COM_CONTENT_WRITTEN_BY', htmlspecialchars($author, ENT_COMPAT, 'UTF-8'));
     $button = JHTML::_('link', JRoute::_($url), $text);
     $output = '<span class="hasTip" title="' . JText::_('COM_CONTENT_EDIT_ITEM') . ' :: ' . $overlib . '">' . $button . '</span>';
     return $output;
 }
Example #3
0
 static function edit($weblink, $params, $attribs = array())
 {
     $user = JFactory::getUser();
     $uri = JFactory::getURI();
     if ($params && $params->get('popup')) {
         return;
     }
     if ($weblink->state < 0) {
         return;
     }
     JHtml::_('behavior.tooltip');
     $url = WeblinksHelperRoute::getFormRoute($weblink->id, base64_encode($uri));
     $icon = $weblink->state ? 'edit.png' : 'edit_unpublished.png';
     $text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true);
     if ($weblink->state == 0) {
         $overlib = JText::_('JUNPUBLISHED');
     } else {
         $overlib = JText::_('JPUBLISHED');
     }
     $date = JHtml::_('date', $weblink->created);
     $author = $weblink->created_by_alias ? $weblink->created_by_alias : $weblink->author;
     $overlib .= '&lt;br /&gt;';
     $overlib .= $date;
     $overlib .= '&lt;br /&gt;';
     $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
     $button = JHtml::_('link', JRoute::_($url), $text);
     $output = '<span class="hasTip" title="' . JText::_('COM_WEBLINKS_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>';
     return $output;
 }
Example #4
0
 /**
  * Render the feed
  *
  * @access public
  * @return string
  */
 function render()
 {
     $now =& JFactory::getDate();
     $data =& $this->_doc;
     $uri =& JFactory::getURI();
     $url = $uri->toString(array('scheme', 'user', 'pass', 'host', 'port'));
     $syndicationURL =& JRoute::_('&format=feed&type=atom');
     $feed = "<feed xmlns=\"http://www.w3.org/2005/Atom\" ";
     if ($data->language != "") {
         $feed .= " xml:lang=\"" . $data->language . "\"";
     }
     $feed .= ">\n";
     $feed .= "\t<title type=\"text\">" . htmlspecialchars($data->title, ENT_COMPAT, 'UTF-8') . "</title>\n";
     $feed .= "\t<subtitle type=\"text\">" . htmlspecialchars($data->description, ENT_COMPAT, 'UTF-8') . "</subtitle>\n";
     $feed .= "\t<link rel=\"alternate\" type=\"text/html\" href=\"" . $url . "\"/>\n";
     $feed .= "\t<id>" . str_replace(' ', '%20', $data->getBase()) . "</id>\n";
     $feed .= "\t<updated>" . htmlspecialchars($now->toISO8601(), ENT_COMPAT, 'UTF-8') . "</updated>\n";
     if ($data->editor != "") {
         $feed .= "\t<author>\n";
         $feed .= "\t\t<name>" . $data->editor . "</name>\n";
         if ($data->editorEmail != "") {
             $feed .= "\t\t<email>" . htmlspecialchars($data->editorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n";
         }
         $feed .= "\t</author>\n";
     }
     $feed .= "\t<generator uri=\"http://joomla.org\" version=\"1.5\">" . $data->getGenerator() . "</generator>\n";
     $feed .= '<link rel="self" type="application/atom+xml" href="' . str_replace(' ', '%20', $url . $syndicationURL) . "\" />\n";
     for ($i = 0; $i < count($data->items); $i++) {
         $feed .= "\t<entry>\n";
         $feed .= "\t\t<title>" . htmlspecialchars(strip_tags($data->items[$i]->title), ENT_COMPAT, 'UTF-8') . "</title>\n";
         $feed .= '		<link rel="alternate" type="text/html" href="' . $url . $data->items[$i]->link . "\"/>\n";
         if ($data->items[$i]->date == "") {
             $data->items[$i]->date = $now->toUnix();
         }
         $itemDate =& JFactory::getDate($data->items[$i]->date);
         $feed .= "\t\t<published>" . htmlspecialchars($itemDate->toISO8601(), ENT_COMPAT, 'UTF-8') . "</published>\n";
         $feed .= "\t\t<updated>" . htmlspecialchars($itemDate->toISO8601(), ENT_COMPAT, 'UTF-8') . "</updated>\n";
         $feed .= "\t\t<id>" . str_replace(' ', '%20', $url . $data->items[$i]->link) . "</id>\n";
         if ($data->items[$i]->author != "") {
             $feed .= "\t\t<author>\n";
             $feed .= "\t\t\t<name>" . htmlspecialchars($data->items[$i]->author, ENT_COMPAT, 'UTF-8') . "</name>\n";
             if ($data->items[$i]->authorEmail != "") {
                 $feed .= "\t\t<email>" . htmlspecialchars($data->items[$i]->authorEmail, ENT_COMPAT, 'UTF-8') . "</email>\n";
             }
             $feed .= "\t\t</author>\n";
         }
         if ($data->items[$i]->description != "") {
             //$feed.= "		<summary type=\"html\">".htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8')."</summary>\n";
             //$feed.= "		<content type=\"html\">".htmlspecialchars($data->items[$i]->description, ENT_COMPAT, 'UTF-8')."</content>\n";
             $feed .= "\t\t<summary type=\"html\">" . htmlspecialchars($this->_relToAbs($data->items[$i]->description)) . "</summary>\n";
             $feed .= "\t\t<content type=\"html\">" . htmlspecialchars($this->_relToAbs($data->items[$i]->description)) . "</content>\n";
         }
         if ($data->items[$i]->enclosure != NULL) {
             $feed .= "\t\t<link rel=\"enclosure\" href=\"" . $data->items[$i]->enclosure->url . "\" type=\"" . $data->items[$i]->enclosure->type . "\"  length=\"" . $data->items[$i]->enclosure->length . "\" />\n";
         }
         $feed .= "\t</entry>\n";
     }
     $feed .= "</feed>\n";
     return $feed;
 }
Example #5
0
 protected function getInput()
 {
     JHtml::_('behavior.modal', 'a.modal');
     $script = array();
     $script[] = '	function jSelectArticle_' . $this->id . '(id, title, catid, object) {';
     $script[] = '		document.id("' . $this->id . '_id").value = id;';
     $script[] = '		document.id("' . $this->id . '_name").value = title;';
     $script[] = '		SqueezeBox.close();';
     $script[] = '	}';
     JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
     $html = array();
     $uri = JFactory::getURI();
     $link = JURI::root(true) . '/modules/mod_junewsultra/img/imgsetting.php';
     $html[] = '<div style="clear: both;"></div><div class="button2-left">';
     $html[] = '  <div class="blank">';
     $html[] = '	<a class="modal" title="' . JText::_('MOD_JUNEWS_IMAGE_CONF') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 980, y: 590}}">' . JText::_('MOD_JUNEWS_IMAGE_CONF') . '</a>';
     $html[] = '  </div>';
     $html[] = '</div>';
     $html[] = '<div class="button2-left">';
     $html[] = '  <div class="blank">';
     $html[] = '	<a class="modal" title="' . JText::_('MOD_JUNEWS_NOTICE12') . '" href="' . $link . '?clearcache=1" rel="{handler: \'iframe\', size: {x: 330, y: 130}}">' . JText::_('MOD_JUNEWS_NOTICE12') . '</a>';
     $html[] = '  </div>';
     $html[] = '</div>';
     /*	$html[] = '<div class="button2-left">';
     		$html[] = '  <div class="blank">';
     		$html[] = '	<a class="modal" title="'.JText::_('MOD_JUNEWS_DONATE').'" href="'. JURI::root( true ).'/modules/mod_junewsultra/fields/donate.php" rel="{handler: \'iframe\', size: {x: 400, y: 450}}">'.JText::_('MOD_JUNEWS_DONATE').'</a>';
     		$html[] = '  </div>';
     		$html[] = '</div>';  */
     $html[] = '<p style="clear: both;" />';
     return implode("\n", $html);
 }
Example #6
0
 public function display($tpl = null)
 {
     $context = "rating";
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $user = JFactory::getUser();
     $document->setTitle(JText::_('COM_REDSHOP_RATING'));
     JToolBarHelper::title(JText::_('COM_REDSHOP_RATING_MANAGEMENT'), 'redshop_rating48');
     JToolBarHelper::addNewX();
     JToolBarHelper::editListX();
     JToolBarHelper::deleteList();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'rating_id');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $ratings = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $this->user = $user;
     $this->lists = $lists;
     $this->ratings = $ratings;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
 function _displayForm($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $model = $this->getModel();
     //get the project
     $object =& $this->get('data');
     $isNew = $object->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_JOOMLEAGUE_ADMIN_LEAGUE'), $object->name);
         $mainframe->redirect('index.php?option=' . $option, $msg);
     }
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // initialise new record
         $object->order = 0;
     }
     $extended = $this->getExtended($object->extended, 'league');
     $this->assignRef('extended', $extended);
     $this->assignRef('object', $object);
     $this->assignRef('form', $this->get('form'));
     $this->assign('cfg_which_media_tool', JComponentHelper::getParams($option)->get('cfg_which_media_tool', 0));
     $this->addToolbar();
     parent::display($tpl);
 }
Example #8
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     // Get a reference of the page instance in joomla
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     $js = $this->baseurl . '/components/' . $option . '/assets/js/json2.js';
     $document->addScript($js);
     $js = $this->baseurl . '/components/' . $option . '/assets/js/swfobject.js';
     $document->addScript($js);
     $division = JRequest::getInt('division', 0);
     $model = $this->getModel();
     $rankingconfig = $model->getTemplateConfig("ranking");
     $flashconfig = $model->getTemplateConfig("flash");
     $config = $model->getTemplateConfig($this->getName());
     $this->project = $model->getProject();
     if (isset($this->project)) {
         $this->overallconfig = $model->getOverallConfig();
         if (!isset($this->overallconfig['seperator'])) {
             $this->overallconfig['seperator'] = ":";
         }
         $this->config = $config;
         $this->model = $model;
         $this->colors = $model->getColors($rankingconfig['colors']);
         $this->division = $model->getDivision($division);
         $this->team1 = $model->getTeam1($division);
         $this->team2 = $model->getTeam2($division);
         $this->_setChartdata(array_merge($flashconfig, $rankingconfig));
     }
     //parent::display( $tpl );
 }
Example #9
0
 public function display($tpl = null)
 {
     $uri = JFactory::getURI();
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->extension_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_SHIPPING') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_shipping48');
     $adminpath = JPATH_ROOT . '/plugins';
     $shippingpath = $adminpath . '/' . $detail->folder . '/' . $detail->element . '/' . $detail->element . '.xml';
     $shippingcfg = $adminpath . '/' . $detail->folder . '/' . $detail->element . '/' . $detail->element . '.cfg.php';
     if (file_exists($shippingcfg)) {
         include_once $shippingcfg;
     }
     $myparams = new JRegistry($detail->params, $shippingpath);
     $is_shipper = $myparams->get('is_shipper');
     $shipper_location = $myparams->get('shipper_location');
     if ($is_shipper) {
         JToolBarHelper::custom('shipping_rate', 'redshop_shipping_rates32', JText::_('COM_REDSHOP_SHIPPING_RATE_LBL'), JText::_('COM_REDSHOP_SHIPPING_RATE_LBL'), false, false);
     } elseif ($shipper_location) {
         JToolBarHelper::custom('shipping_rate', 'redshop_shipping_rates32', JText::_('COM_REDSHOP_SHIPPING_LOCATION'), JText::_('COM_REDSHOP_SHIPPING_LOCATION'), false, false);
     }
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::cancel();
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->enabled);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Example #10
0
    /**
     * Check and load assets file if needed
     */
    function loadAsset()
    {
        if (!defined('_T3_DEPEND_ASSET_')) {
            define('_T3_DEPEND_ASSET_', 1);
            $jdoc = JFactory::getDocument();
            if (!defined('T3_TEMPLATE')) {
                JFactory::getLanguage()->load(T3_PLUGIN, JPATH_ADMINISTRATOR);
                if (version_compare(JVERSION, '3.0', 'ge')) {
                    JHtml::_('jquery.framework');
                } else {
                    $jdoc->addScript(T3_ADMIN_URL . '/admin/js/jquery-1.8.3.min.js');
                    $jdoc->addScript(T3_ADMIN_URL . '/admin/js/jquery.noconflict.js');
                }
            }
            if (JFactory::getApplication()->isSite() || !defined('T3_TEMPLATE')) {
                $jdoc->addStyleSheet(T3_ADMIN_URL . '/includes/depend/css/depend.css');
                $jdoc->addScript(T3_ADMIN_URL . '/includes/depend/js/depend.js');
            }
            JFactory::getDocument()->addScriptDeclaration('
				jQuery.extend(T3Depend, {
					adminurl: \'' . JFactory::getURI()->toString() . '\',
					rooturl: \'' . JURI::root() . '\'
				});
			');
        }
    }
Example #11
0
 function display($tpl = null)
 {
     global $mainframe, $option;
     if ($this->getLayout() == 'form') {
         $this->_displayForm($tpl);
         return;
     }
     //JToolBarHelper::title( JText::_( 'Restoration' ), 'generic.png' );
     $html = "<div class=\"header icon-48-generic.png\" style='background-image:url(components/com_jdefender/images/dbrestore.png)'>\n";
     $html .= JText::_('Restoration');
     $html .= "\n</div>\n";
     $mainframe->set('JComponentTitle', $html);
     JToolBarHelper::deleteList();
     JToolBarHelper::addNewX();
     $html = "<a href=\"javascript:void(0);\" onclick=\"javascript:" . "document.adminForm; submitbutton('restore');\" class=\"toolbar\">";
     $html .= "<span style='background-image:url(components/com_jdefender/images/dbrestore32.gif);' type=\"Standard\">";
     $html .= "</span>";
     $html .= JText::_('Restore');
     $html .= "</a>";
     $bar =& JToolBar::getInstance();
     $bar->appendButton('Custom', $html, 'close');
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     $items =& $this->get('Data');
     $pagination =& $this->get('Pagination');
     $this->assignRef('pagination', $pagination);
     $this->assignRef('restorations', $items);
     parent::display($tpl);
 }
Example #12
0
 /**
  * Class constructor
  *
  * @param   array  $options  Associative array of options
  *
  * @since  11.1
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Set document type
     $this->_type = 'opensearch';
     // Set mime type
     $this->_mime = 'application/opensearchdescription+xml';
     // Add the URL for self updating
     $update = new JOpenSearchUrl();
     $update->type = 'application/opensearchdescription+xml';
     $update->rel = 'self';
     $update->template = JRoute::_(JFactory::getURI());
     $this->addUrl($update);
     // Add the favicon as the default image
     // Try to find a favicon by checking the template and root folder
     $app = JFactory::getApplication();
     $dirs = array(JPATH_THEMES . '/' . $app->getTemplate(), JPATH_BASE);
     foreach ($dirs as $dir) {
         if (file_exists($dir . '/favicon.ico')) {
             $path = str_replace(JPATH_BASE . '/', '', $dir);
             $path = str_replace('\\', '/', $path);
             $favicon = new JOpenSearchImage();
             $favicon->data = JURI::base() . $path . '/favicon.ico';
             $favicon->height = '16';
             $favicon->width = '16';
             $favicon->type = 'image/vnd.microsoft.icon';
             $this->addImage($favicon);
             break;
         }
     }
 }
Example #13
0
 public function display($tpl = null)
 {
     $option = JRequest::getVar('option');
     $userslist = JRequest::getVar('userslist', array());
     JToolBarHelper::title(JText::_('COM_REDSHOP_COUPON_MANAGEMENT_DETAIL'), 'redshop_coupon48');
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/' . $option . '/assets/css/search.css');
     $document->addScript('components/' . $option . '/assets/js/search.js');
     $uri = JFactory::getURI();
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->coupon_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_COUPON') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_coupon48');
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $model = $this->getModel('coupon_detail');
     $lists['free_shipping'] = JHTML::_('select.booleanlist', 'free_shipping', 'class="inputbox" ', $detail->free_shipping);
     $percent_or_total = array(JHTML::_('select.option', 'no', JText::_('COM_REDSHOP_SELECT')), JHTML::_('select.option', 0, JText::_('COM_REDSHOP_TOTAL')), JHTML::_('select.option', 1, JText::_('COM_REDSHOP_PERCENTAGE')));
     $lists['percent_or_total'] = JHTML::_('select.genericlist', $percent_or_total, 'percent_or_total', 'class="inputbox" size="1"', 'value', 'text', $detail->percent_or_total);
     $coupon_type = array(JHTML::_('select.option', 'no', JText::_('COM_REDSHOP_SELECT')), JHTML::_('select.option', 0, JText::_('COM_REDSHOP_GLOBAL')), JHTML::_('select.option', 1, JText::_('COM_REDSHOP_USER_SPECIFIC')));
     $lists['coupon_type'] = JHTML::_('select.genericlist', $coupon_type, 'coupon_type', 'class="inputbox" size="1"', 'value', 'text', $detail->coupon_type);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     $lists['userslist'] = JHTML::_('select.genericlist', $userslist, 'userid', 'class="inputbox" size="1" ', 'value', 'text', $detail->userid);
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
 function _displayForm($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     $uri = JFactory::getURI();
     $user = JFactory::getUser();
     $model = $this->getModel();
     $lists = array();
     //get the matchday
     $round =& $this->get('data');
     $isNew = $round->id < 1;
     // fail if checked out not by 'me'
     if ($model->isCheckedOut($user->get('id'))) {
         $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('The matchday'), $round->name);
         $mainframe->redirect('index.php?option=' . $option, $msg);
     }
     // Edit or Create?
     if (!$isNew) {
         $model->checkout($user->get('id'));
     } else {
         // initialise new record
         $round->order = 0;
     }
     $projectws =& $this->get('Data', 'projectws');
     $this->assignRef('projectws', $projectws);
     #$this->assignRef('lists',$lists);
     $this->assignRef('matchday', $round);
     $this->assignRef('form', $this->get('form'));
     //$extended = $this->getExtended($round->extended, 'round');
     //$this->assignRef( 'extended', $extended );
     $this->addToolbar();
     parent::display($tpl);
 }
Example #15
0
 function display($tpl = null)
 {
     $option = JRequest::getCmd('option');
     $mainframe = JFactory::getApplication();
     $uri = JFactory::getURI();
     $filter_order = $mainframe->getUserStateFromRequest($option . 's_filter_order', 'filter_order', 's.ordering', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($option . 's_filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest($option . 's_search', 'search', '', 'string');
     $search = JString::strtolower($search);
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $user = JFactory::getUser();
     $this->user = $user;
     $this->lists = $lists;
     $this->items = $items;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     $this->addToolbar();
     parent::display($tpl);
 }
Example #16
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     $option = 'com_k2store';
     $ns = 'com_k2store.fields';
     $db = JFactory::getDBO();
     $uri = JFactory::getURI();
     $params = JComponentHelper::getParams('com_k2store');
     $filter_order = $mainframe->getUserStateFromRequest($ns . 'filter_order', 'filter_order', 'a.field_id', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest($ns . 'filter_order_Dir', 'filter_order_Dir', 'ASC', 'word');
     $filter_orderstate = $mainframe->getUserStateFromRequest($ns . 'filter_orderstate', 'filter_orderstate', '', 'string');
     $search = $mainframe->getUserStateFromRequest($ns . 'search', 'search', '', 'string');
     if (strpos($search, '"') !== false) {
         $search = str_replace(array('=', '<'), '', $search);
     }
     $search = JString::strtolower($search);
     // Get data from the model
     $items = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // search filter
     $lists['search'] = $search;
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
     $this->params = $params;
     $model = $this->getModel();
     $this->addToolBar();
     $toolbar = new K2StoreToolBar();
     $toolbar->renderLinkbar();
     parent::display($tpl);
 }
Example #17
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $uri = JFactory::getURI();
     JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css');
     $this->field = JRequest::getVar('field');
     $this->fce = 'phocaSelectFbAlbum_' . $this->field;
     //$eName	= JRequest::getVar('e_name');
     //$eName	= preg_replace( '#[^A-Z0-9\-\_\[\]]#i', '', $eName );
     $uid = JRequest::getVar('uid', 0, '', 'int');
     $db = JFactory::getDBO();
     $query = 'SELECT a.*' . ' FROM #__phocagallery_fb_users AS a' . ' WHERE a.published = 1' . ' AND a.id = ' . (int) $uid . ' ORDER BY a.ordering';
     $db->setQuery($query);
     $user = $db->loadObject();
     if (!isset($user->uid)) {
         $this->userInfo = 0;
     } else {
         $session = PhocaGalleryFbSystem::setSessionData($user);
         $this->albums = PhocaGalleryFb::getFbAlbums($user->appid, $user->fanpageid, $user->appsid, $session);
         $this->userInfo = 1;
     }
     //$this->assignRef('tmpl',	$tmpl);
     parent::display($tpl);
 }
Example #18
0
 function edit($article, $params, $access, $attribs = array())
 {
     $user =& JFactory::getUser();
     $uri =& JFactory::getURI();
     $ret = $uri->toString();
     if ($params->get('popup')) {
         return;
     }
     if ($article->state < 0) {
         return;
     }
     if (!$access->canEdit && !($access->canEditOwn && $article->created_by == $user->get('id'))) {
         return;
     }
     JHTML::_('behavior.tooltip');
     $url = 'index.php?view=article&id=' . $article->slug . '&task=edit&ret=' . base64_encode($ret);
     $icon = $article->state ? 'edit.png' : 'edit_unpublished.png';
     $text = JHTML::_('image.site', $icon, '/images/M_images/', NULL, NULL, JText::_('Edit'));
     if ($article->state == 0) {
         $overlib = JText::_('Unpublished');
     } else {
         $overlib = JText::_('Published');
     }
     $date = JHTML::_('date', $article->created);
     $author = $article->created_by_alias ? $article->created_by_alias : $article->author;
     $overlib .= '&lt;br /&gt;';
     $overlib .= JText::_($article->groups);
     $overlib .= '&lt;br /&gt;';
     $overlib .= $date;
     $overlib .= '&lt;br /&gt;';
     $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8');
     $button = JHTML::_('link', JRoute::_($url), $text);
     $output = '<span class="hasTip" title="' . JText::_('Edit Item') . ' :: ' . $overlib . '">' . $button . '</span>';
     return $output;
 }
 function _displayDefault($tpl)
 {
     $option = JRequest::getCmd('option');
     $mainframe =& JFactory::getApplication();
     $uri =& JFactory::getURI();
     $cid = JRequest::getCmd('cid');
     $match_id = $cid[0];
     $model =& $this->getModel();
     /*
     		$filter_state		= $mainframe->getUserStateFromRequest($option.'mc_filter_state',	'filter_state', 	'', 'word');
     		$filter_order		= $mainframe->getUserStateFromRequest($option.'mc_filter_order',	'filter_order', 	'mc.match_number', 'cmd');
     		$filter_order_Dir	= $mainframe->getUserStateFromRequest($option.'mc_filter_order_Dir','filter_order_Dir', '', 'word');
     		$search				= $mainframe->getUserStateFromRequest($option.'mc_search', 'search',					'', 'string');
     		$search_mode		= $mainframe->getUserStateFromRequest($option.'mc_search_mode',		'search_mode',		'', 'string');
     		$division			= $mainframe->getUserStateFromRequest($option.'mc_division',		'division',			'',	'string');
     		$project_id			= $mainframe->getUserState( $option . 'project' );
     		$search				= JString::strtolower($search);
     */
     $matches =& $this->get('Data');
     $total =& $this->get('Total');
     $pagination =& $this->get('Pagination');
     $match = $model->getMatchData($match_id);
     echo 'getModel<pre>' . print_r($model, true) . '</pre><br>';
     $this->assignRef('homeplayer', $model->HomeTeamPlayer());
     $this->assignRef('awayplayer', $model->AwayTeamPlayer());
     $this->assignRef('matches', $matches);
     $this->assignRef('match', $match);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('lists', $lists);
     $this->assignRef('request_url', $uri->toString());
     parent::display($tpl);
 }
Example #20
0
 public function display($tpl = null)
 {
     global $context;
     $shoppergroup = new shoppergroup();
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_SHOPPER_GROUP'));
     jimport('joomla.html.pagination');
     JToolBarHelper::title(JText::_('COM_REDSHOP_SHOPPER_GROUP_MANAGEMENT'), 'redshop_manufact48');
     JToolBarHelper::addNewX();
     JToolBarHelper::editListX();
     JToolBarHelper::deleteList();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'shopper_group_id');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $groups = $shoppergroup->getshopperGroupListArray();
     $pagination = $this->get('Pagination');
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     $this->media = $groups;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Example #21
0
 function getCategory($id)
 {
     $app = JFactory::getApplication();
     if ($id > 0) {
         $query = 'SELECT c.*,' . ' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\':\', c.id, c.alias) ELSE c.id END as slug ' . ' FROM #__phocagallery_categories AS c' . ' WHERE c.id = ' . (int) $id;
         $this->_db->setQuery($query, 0, 1);
         $category = $this->_db->loadObject();
         $user = JFactory::getUser();
         // USER RIGHT - ACCESS - - - - - -
         $rightDisplay = 1;
         //default is set to 1 (all users can see the category)
         if (!empty($category)) {
             $rightDisplay = PhocaGalleryAccess::getUserRight('accessuserid', $category->accessuserid, $category->access, $user->getAuthorisedViewLevels(), $user->get('id', 0), 0);
         }
         if ($rightDisplay == 0) {
             $uri = JFactory::getURI();
             $tmpl['pl'] = 'index.php?option=com_users&view=login&return=' . base64_encode($uri->toString());
             $app->redirect(JRoute::_($tmpl['pl'], false), JText::_('COM_PHOCAGALLERY_NOT_AUTHORISED_ACTION'));
             exit;
         }
         // - - - - - - - - - - - - - - - -
         return $category;
     }
     return false;
 }
Example #22
0
 public static function getHTML($url, $sortItems = array(), $defaultSort = '', $filterItems = array(), $defaultFilter = '')
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $cleanURL = $url;
     $uri = JFactory::getURI();
     $queries = $_REQUEST;
     $allow = array('option', 'view', 'browse', 'task');
     foreach ($queries as $key => $value) {
         if (!in_array($key, $allow)) {
             unset($queries[$key]);
         }
     }
     $selectedSort = $jinput->get->get('sort', $defaultSort, 'STRING');
     $selectedFilter = $jinput->get->get('filter', $defaultFilter, 'STRING');
     $tmpl = new CTemplate();
     $tmpl->set('queries', $queries);
     $tmpl->set('selectedSort', $selectedSort);
     $tmpl->set('selectedFilter', $selectedFilter);
     $tmpl->set('sortItems', $sortItems);
     $tmpl->set('uri', $uri);
     $tmpl->set('filterItems', $filterItems);
     $tmpl->set('jinput', $jinput);
     return $tmpl->fetch('filterbar.html');
 }
Example #23
0
 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();
     }
 }
 function _displayForm($tpl)
 {
     $mainframe =& JFactory::getApplication();
     $option = JRequest::getCmd('option');
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     $user =& JFactory::getUser();
     $model =& $this->getModel();
     $lists = array();
     //get the member data
     $predictionuser =& $this->get('data');
     $isNew = $predictionuser->id < 1;
     // Edit or Create?
     if (!$isNew) {
         //$model->checkout( $user->get( 'id' ) );
     } else {
         // initialise new record
         $predictionuser->order = 0;
     }
     /*        
             //build the html select list for parent positions
     		$parents[] = JHTML::_( 'select.option', '0', '- ' . JText::_( 'Prediction Group' ) . ' -' );
     		if ( $res =& $model->getPredictionGroups() )
     		{
     			$parents = array_merge( $parents, $res );
     		}
     		$lists['parents'] = JHTML::_(	'select.genericlist', $parents, 'group_id', 'class="inputbox" size="1"', 'value', 'text',
     										$predictionuser->group_id );
     		unset( $parents );
     */
     //$this->assignRef( 'lists',			$lists );
     $this->assignRef('form', $this->get('form'));
     $this->assignRef('predictionuser', $predictionuser);
     parent::display($tpl);
 }
Example #25
0
 public function display($tpl = null)
 {
     $Redconfiguration = new Redconfiguration();
     $uri = JFactory::getURI();
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->zipcode_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_ZIPCODE_DETAIL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_region_48');
     JToolBarHelper::save();
     JToolBarHelper::apply();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $countryarray = $Redconfiguration->getCountryList((array) $detail);
     $detail->country_code = $countryarray['country_code'];
     $lists['country_code'] = $countryarray['country_dropdown'];
     $statearray = $Redconfiguration->getStateList((array) $detail);
     $lists['state_code'] = $statearray['state_dropdown'];
     $this->detail = $detail;
     $this->lists = $lists;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Example #26
0
 public function display($tpl = null)
 {
     global $context;
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_GIFTCARD'));
     JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARD_MANAGEMENT'), 'redshop_giftcard_48');
     JToolBarHelper::addNewX();
     JToolBarHelper::editListX();
     JToolBarHelper::customX('copy', 'copy.png', 'copy_f2.png', JText::_('COM_REDSHOP_TOOLBAR_COPY'), true);
     JToolBarHelper::deleteList();
     JToolBarHelper::publishList();
     JToolBarHelper::unpublishList();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'giftcard_id');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', '');
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $giftcard = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $this->user = JFactory::getUser();
     $this->lists = $lists;
     $this->giftcard = $giftcard;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Example #27
0
 public function getDanhsach()
 {
     $data = $this->inputData();
     $vName = JRequest::getString('view');
     AdminTochucHelper::addSubmenu($vName);
     AdminTochucHelper::addButton($vName);
     $this->mainframe = JFactory::getApplication();
     $this->option = JRequest::getWord('option');
     $uri = JFactory::getURI();
     $status = $this->mainframe->getUserStateFromRequest($this->option . 'status', 'status', '', 'string');
     $filter_order = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order', 'filter_order', 'name', 'cmd');
     $filter_order_Dir = $this->mainframe->getUserStateFromRequest($this->option . 'filter_order_Dir', 'filter_order_Dir', '', 'word');
     $search = $this->mainframe->getUserStateFromRequest($this->option . 'search', 'search', '', 'string');
     if (strpos($search, '"') !== false) {
         $search = str_replace(array('=', '<'), '', $search);
     }
     $search = JString::strtolower($search);
     if (!in_array(strtoupper($filter_order_Dir), array('ASC', 'DESC'))) {
         $filter_order_Dir = '';
     }
     $javascript = 'onchange="document.adminForm.submit()"';
     $lists['status'] = JHTML::_('select.genericlist', array(array('value' => '', 'text' => '--Trạng thái--'), array('value' => '1', 'text' => 'Sử dụng'), array('value' => '0', 'text' => 'Không sử dụng')), 'status', $javascript . ' class="inputbox" size="1"', 'value', 'text', $status);
     $model = JModelLegacy::getInstance('tochucdang', 'TochucModel');
     $items = $model->listDanhsach($data['table']);
     $totals = $model->getTotal($data['table']);
     $pagination = $model->getPagination($data['table']);
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $lists['search'] = $search;
     $this->sidebar = JHtmlSidebar::render();
     $this->assignRef('data', $data);
     $this->assignRef('lists', $lists);
     $this->assignRef('items', $items);
     $this->assignRef('pagination', $pagination);
 }
Example #28
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     JHtml::_('behavior.tooltip');
     JHtml::_('behavior.formvalidation');
     JHtml::_('behavior.keepalive');
     JHtml::_('formbehavior.chosen', 'select');
     //Frontend Changes
     $tUri = '';
     if (!$app->isAdmin()) {
         $tUri = JURI::base();
     }
     $document = JFactory::getDocument();
     $uri =& JFactory::getURI();
     JHTML::stylesheet('media/com_phocagallery/css/administrator/phocagallery.css');
     $eName = JRequest::getVar('e_name');
     $eName = preg_replace('#[^A-Z0-9\\-\\_\\[\\]]#i', '', $eName);
     $tmpl['categories'] = $tUri . 'index.php?option=com_phocagallery&amp;view=phocagallerylinkcats&amp;tmpl=component&amp;e_name=' . $eName;
     //$tmpl['COM_PHOCAGALLERY_CATEGORY']		= 'index.php?option=com_phocagallery&amp;view=phocagallerylinkcat&amp;tmpl=component&amp;e_name='.$eName;
     $tmpl['images'] = $tUri . 'index.php?option=com_phocagallery&amp;view=phocagallerylinkimg&amp;type=2&amp;tmpl=component&amp;e_name=' . $eName;
     $tmpl['image'] = $tUri . 'index.php?option=com_phocagallery&amp;view=phocagallerylinkimg&amp;type=1&amp;tmpl=component&amp;e_name=' . $eName;
     $tmpl['switchimage'] = $tUri . 'index.php?option=com_phocagallery&amp;view=phocagallerylinkimg&amp;type=3&amp;tmpl=component&amp;e_name=' . $eName;
     $tmpl['slideshow'] = $tUri . 'index.php?option=com_phocagallery&amp;view=phocagallerylinkimg&amp;type=4&amp;tmpl=component&amp;e_name=' . $eName;
     $this->assignRef('tmpl', $tmpl);
     parent::display($tpl);
 }
Example #29
0
 public function display($tpl = null)
 {
     JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARD_MANAGEMENT'), 'redshop_giftcard_48');
     $uri = JFactory::getURI();
     jimport('joomla.html.pane');
     $pane = JPane::getInstance('sliders');
     $this->pane = $pane;
     $this->setLayout('default');
     $lists = array();
     $detail = $this->get('data');
     $isNew = $detail->giftcard_id < 1;
     $text = $isNew ? JText::_('COM_REDSHOP_NEW') : JText::_('COM_REDSHOP_EDIT');
     JToolBarHelper::title(JText::_('COM_REDSHOP_GIFTCARDS') . ': <small><small>[ ' . $text . ' ]</small></small>', 'redshop_giftcard_48');
     JToolBarHelper::apply();
     JToolBarHelper::save();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
     }
     $lists['customer_amount'] = JHTML::_('select.booleanlist', 'customer_amount', 'class="inputbox" ', $detail->customer_amount);
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $detail->published);
     if (ECONOMIC_INTEGRATION == 1) {
         $redhelper = new redhelper();
         $accountgroup = $redhelper->getEconomicAccountGroup();
         $op = array();
         $op[] = JHTML::_('select.option', '0', JText::_('COM_REDSHOP_SELECT'));
         $accountgroup = array_merge($op, $accountgroup);
         $lists["accountgroup_id"] = JHTML::_('select.genericlist', $accountgroup, 'accountgroup_id', 'class="inputbox" size="1" ', 'value', 'text', $detail->accountgroup_id);
     }
     $this->lists = $lists;
     $this->detail = $detail;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }
Example #30
0
 public function display($tpl = null)
 {
     $context = 'quotation_id';
     $quotationHelper = new quotationHelper();
     $uri = JFactory::getURI();
     $app = JFactory::getApplication();
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_REDSHOP_quotation'));
     $model = $this->getModel('quotation');
     JToolBarHelper::title(JText::_('COM_REDSHOP_QUOTATION_MANAGEMENT'), 'redshop_quotation48');
     JToolBarHelper::addNewX();
     JToolBarHelper::editListX();
     JToolBarHelper::deleteList();
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'quotation_cdate');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'DESC');
     $filter_status = $app->getUserStateFromRequest($context . 'filter_status', 'filter_status', 0);
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $quotation = $this->get('Data');
     $total = $this->get('Total');
     $pagination = $this->get('Pagination');
     $optionsection = $quotationHelper->getQuotationStatusList();
     $lists['filter_status'] = JHTML::_('select.genericlist', $optionsection, 'filter_status', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter_status);
     $this->lists = $lists;
     $this->quotation = $quotation;
     $this->pagination = $pagination;
     $this->request_url = $uri->toString();
     parent::display($tpl);
 }