Ejemplo n.º 1
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     require_once JPATH_COMPONENT . DS . 'helper.php';
     $country_code = JRequest::getVar('country_code');
     $helper = new CPHelper();
     $result = $helper->listCities($country_code, null, 'jform[city]', 'jform_city');
     echo $result;
 }
Ejemplo n.º 2
0
 /**
  * display method of Cp view
  * @return void
  **/
 function display($tpl = null)
 {
     // Initialiase variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = empty($this->item->product_id);
     $document = JFactory::getDocument();
     if (JRequest::getVar('tmpl', '') != 'component') {
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-1.10.1.min.js');
         $document->addScriptDeclaration('jQuery.noConflict();');
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-ui-1.10.3.custom.min.js');
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/scripts.js');
         $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/style.css');
         $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/smoothness/jquery-ui-1.8.21.custom.css');
         $document->addStyleDeclaration('body { min-width: 1170px; }');
     }
     // Create the form
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     $text = $isNew ? JText::_('COM_CP_NEW') : JText::_('COM_CP_EDIT');
     JToolBarHelper::title($text . ' ' . JText::_('COM_CP_PRODUCT_PAGE_TITLE'));
     if ($isNew && $user->authorise('core.create', 'com_cp')) {
         JToolBarHelper::apply('cpproducts.apply');
         JToolBarHelper::save('cpproducts.save');
         JToolBarHelper::save2new('cpproducts.save2new');
         JToolBarHelper::cancel('cpproducts.cancel');
     } else {
         if ($user->authorise('core.edit', 'com_cp')) {
             JToolBarHelper::apply('cpproducts.apply');
             JToolBarHelper::save('cpproducts.save');
             if ($user->authorise('core.edit', 'com_cp')) {
                 JToolBarHelper::save2new('cpproducts.save2new');
             }
             JToolBarHelper::cancel('cpproducts.cancel', 'COM_CP_CLOSE');
         }
     }
     $helper = new CPHelper();
     if ($isNew) {
         $countFiles = 0;
     } else {
         $countFiles = count($this->item->media);
     }
     // Initialize media files script
     $document->addScriptDeclaration('var mediaCount = ' . $countFiles . '; var delText = "' . JText::_('COM_CP_DELETE') . '"; var siteURL = "' . JURI::root() . '";');
     $params = JComponentHelper::getParams('com_cp');
     $this->assignRef('params', $params);
     $this->item->cities = $helper->listCities($this->item->country_code, $this->item->city, 'jform[city]', 'jform_city');
     parent::display($tpl);
 }
Ejemplo n.º 3
0
 /**
  * Cpproductslist view display method
  * @return void
  **/
 function display($tpl = null)
 {
     // Get data from the model
     $this->items = $this->get('Items');
     $this->state = $this->get('State');
     $this->pagination = $this->get('Pagination');
     $posibleStates = array();
     $posibleStates[] = JHtml::_('select.option', '1', 'COM_CP_ACTIVE');
     $posibleStates[] = JHtml::_('select.option', '0', 'COM_CP_INACTIVE');
     $this->posibleStates = $posibleStates;
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     // draw menu
     JToolBarHelper::title(JText::_('COM_CP_CP_MANAGER') . ' - ' . JText::_('COM_CP_MENUCPPRODUCTSLIST'), 'generic.png');
     if ($user->authorise('core.create', 'com_cp')) {
         JToolBarHelper::addNew('cpproducts.add');
     }
     if ($user->authorise('core.edit', 'com_cp') || $user->authorise('core.edit.own', 'com_cp')) {
         JToolBarHelper::editList('cpproducts.edit');
     }
     if ($user->authorise('core.edit.state', 'com_cp') && count($this->items)) {
         JToolBarHelper::divider();
         JToolBarHelper::publishList('cpproductslist.publish');
         JToolBarHelper::unpublishList('cpproductslist.unpublish');
         JToolBarHelper::custom('cpproductslist.featured', 'featured.png', 'featured_f2.png', 'JFEATURED', true);
     }
     if ($user->authorise('core.delete', 'com_cp')) {
         JToolBarHelper::divider();
         JToolBarHelper::deleteList('COM_CP_CONFIRM_DELETE_PRODUCT', 'cpproductslist.delete');
     }
     // configuration editor for config.xml
     if ($user->authorise('core.admin', 'com_cp')) {
         JToolBarHelper::divider();
         JToolBarHelper::preferences('com_cp');
     }
     // SORTING get the user state of order and direction
     $helper = new CPHelper();
     $lists = array();
     $lists['category_id'] = $helper->filterCategory($this->state->get('filter.category_id'));
     $lists['tourismtype_id'] = $helper->filterTourismType($this->state->get('filter.tourismtype_id'));
     $this->assignRef('helper', $helper);
     $this->assignRef('lists', $lists);
     parent::display($tpl);
 }
Ejemplo n.º 4
0
 public function AddExtraHTMLToSidebar(&$company)
 {
     define('API', 'PS');
     require_once 'siteadmin/includes/config/affiliatewindow.php';
     $result = CPHelper::getStaggImageHTML($company['staggurl']);
     $result .= '<div id="sidebar-merchantDescription-main"><h3>' . (empty($company['sidebar_title']) ? 'Quick Glance' : $company['sidebar_title']) . '</h3>';
     $result .= mb_str_replace('{logo}', '<img src="' . $company['logourl'] . '" style="float:left; margin:5px;"/>', $company['sidebar']);
     if (!empty($company['displayurl'])) {
         list($cloakedURL, $realURL) = CPHelper::getCompanyURLs($company['id'], $company['displayurl'], $company['source']);
         $result .= '<ul><li class="official-website"><h4>Official Website</h4><a href="' . $cloakedURL . '" target="_blank">' . $realURL . '</a></li></ul>';
     }
     $result .= '</div>';
     $company['sidebar'] = $result;
 }
Ejemplo n.º 5
0
?>
" />
</form>
<div id="articleContent" >
<h3 style="margin-bottom:0px;"><?php 
echo $this->catname;
?>
</h3>
<div style="color:#666;"><em><?php 
echo $this->results_description;
?>
</em></div>
<div style="clear:both;margin-bottom:20px;"></div>
<?php 
foreach ($this->list as $i => $item) {
    list($cloakedURL, $realURL) = CPHelper::getCompanyURLs($item['id'], $item['displayurl'], $item['source']);
    //echo "cloakedURL=<pre>";print_r($cloakedURL);echo "</pre><hr>";
    //echo "this->plist_c=<pre>";print_r($this->plist_c);echo "</pre><hr>";
    $logo = !empty($item['logourl']) ? '<img src="' . $item['logourl'] . '" style="float:left; margin:5px;" />' : '';
    $description = mb_str_replace('{logoleft}', '', strip_tags($item['content']));
    $description = mb_strlen($description) > 250 ? mb_substr($description, 0, 250) . '..' : $description;
    $pageURL = CPRoute::_('index.php?type=base&mod=companies&what=page&cat=' . $item['path'] . '&page=' . $item['alias']);
    ?>
	<table cellpadding="0" cellspacing="0" border="0">
	<tr>
	<td style="width:100px;" valign="top"><a href="<?php 
    echo $pageURL;
    ?>
"><?php 
    echo $logo;
    ?>