예제 #1
0
 /**
  * Constructor.
  *
  * @param	array An optional associative array of configuration settings.
  * @see		JController
  * @since	1.6
  */
 public function __construct($config = array())
 {
     $this->input = JFactory::getApplication()->input;
     parent::__construct($config);
     // Guess the JText message prefix. Defaults to the option.
     if (empty($this->extension)) {
         $this->extension = JRequest::getCmd('extension', 'com_content');
     }
     // If the joomla's version is more than or equal to 3.0
     if (!COM_TZ_PORTFOLIO_JVERSION_COMPARE) {
         JHtml::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tz_portfolio/libraries/cms/html');
         tzportfolioimport('cms/html/sidebar');
         $doc = JFactory::getDocument();
         //Add Script to the header
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/jquery.min.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/jquery-noconflict.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/bootstrap.min.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/chosen.jquery.min.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/jquery.ui.core.min.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/jquery.ui.sortable.min.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/js/sortablelist.js');
         $doc->addScript(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/js/template.min.js');
         $doc->addStyleSheet(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/jui/css/chosen.min.css');
         //                    $doc -> addStyleSheet(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH.'/jui/css/bootstrap.min.css');
         //        $doc -> addStyleSheet(COM_TZ_PORTFOLIO_ADMIN_HOST_PATH.'/css/template.css');
         $doc->addCustomTag('<link href="' . COM_TZ_PORTFOLIO_ADMIN_HOST_PATH . '/css/template.min.css' . '" rel="stylesheet" type="text/css"/>');
     }
 }
예제 #2
0
 /**
  * Votes an image via AJAX
  *
  * @return  void
  * @since   2.1
  */
 public function vote()
 {
     require_once JPATH_ADMINISTRATOR . '/components/com_languages/helpers/jsonresponse.php';
     $response = array();
     $model = $this->getModel('vote');
     if (!$model->vote()) {
         echo new JJsonResponse(new Exception($model->getError()));
     } else {
         // HTML for updating the rating
         JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers/html');
         $response['rating'] = JHtml::_('joomgallery.rating', $model->getRating(), true, 'jg_starrating_detail', 'hasHintAjaxVote');
         // Set CSS tooltip class in case of star rating
         $response['tooltipclass'] = '';
         if ($this->_config->get('jg_ratingdisplaytype') == 1) {
             if ($this->_config->get('jg_tooltips') == 2) {
                 $response['tooltipclass'] = 'jg-tooltip-wrap';
             } else {
                 if ($this->_config->get('jg_tooltips') == 1) {
                     $response['tooltipclass'] = 'default';
                 }
             }
         }
         echo new JJsonResponse($response, JText::_('COM_JOOMGALLERY_DETAIL_RATINGS_MSG_YOUR_VOTE_COUNTED'));
     }
 }
예제 #3
0
파일: html.php 프로젝트: ForAEdesWeb/AEW27
 /**
  * prepareRender
  *
  * @return  void
  */
 protected function prepareRender()
 {
     \Windwalker\Helper\LanguageHelper::loadLanguage('com_content');
     // Fix for 3.3.6
     JHtml::addIncludePath(\Windwalker\Helper\PathHelper::getSite('com_content') . '/helpers');
     parent::prepareRender();
 }
예제 #4
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Load plug-in language files.
     FinderHelperLanguage::loadPluginLanguage();
     $this->items = $this->get('Items');
     $this->total = $this->get('Total');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->pluginState = $this->get('pluginState');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     FinderHelper::addSubmenu('index');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if (!$this->pluginState['plg_content_finder']->enabled) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_PLUGIN_CONTENT_NOT_ENABLED'), 'warning');
     } elseif ($this->get('TotalIndexed') === 0) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_FINDER_INDEX_NO_DATA') . '  ' . JText::_('COM_FINDER_INDEX_TIP'), 'notice');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Configure the toolbar.
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
예제 #5
0
	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  A template file to load. [optional]
	 *
	 * @return  mixed  A string if successful, otherwise a JError object.
	 *
	 * @since   1.6
	 */
	public function display($tpl = null)
	{
		$this->categories	= $this->get('CategoryOrders');
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode("\n", $errors));
			return false;
		}

		BannersHelper::addSubmenu('banners');

		$this->addToolbar();
		require_once JPATH_COMPONENT . '/models/fields/bannerclient.php';

		// Include the component HTML helpers.
		JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

		$this->sidebar = JHtmlSidebar::render();
		parent::display($tpl);
	}
예제 #6
0
 /**
  * Returns the HTML for a OpenImage select box form field.
  *
  * @return  string  The OpenImage select box form field.
  * @since   3.0
  */
 protected function getInput()
 {
     JHtml::addIncludePath(JPATH_BASE . '/components/com_joomgallery/helpers/html');
     $class = $this->element['class'] ? (string) $this->element['class'] : '';
     if ($this->element['required'] && $this->element['required'] == true && strpos($class, 'required') === false) {
         if (!empty($class)) {
             $class .= ' ';
         }
         $class .= 'required';
     }
     $attr = '';
     $attr .= !empty($class) ? ' class="' . $class . '"' : '';
     $attr .= (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
     $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
     $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
     $detail = true;
     if ((string) $this->element['detail'] == 'false') {
         $detail = false;
     }
     $default = false;
     if ((string) $this->element['defaultMethod'] == 'true') {
         $default = true;
     }
     $prefix = 'COM_JOOMGALLERY_CONFIG_CV_GS_';
     if ($this->element['prefix']) {
         $prefix = (string) $this->element['prefix'];
     }
     return JHtml::_('joomselect.openimage', $this->name, $this->value, $detail, $default, $prefix, $attr, parent::getOptions());
 }
예제 #7
0
 public function getLabel()
 {
     global $jlistConfig;
     $app = JFactory::getApplication();
     JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
     $label = '';
     $replace = '';
     // Get the label text from the XML element, defaulting to the element name.
     if ($app->isAdmin()) {
         $text = $this->element['label'] ? (string) $this->element['label'] : (string) JDownloadsHelper::getOnlyLanguageSubstring($jlistConfig['custom.field.11.title']);
     } else {
         $text = $this->element['label'] ? (string) $this->element['label'] : (string) JDHelper::getOnlyLanguageSubstring($jlistConfig['custom.field.11.title']);
     }
     // Build the class for the label.
     $class = !empty($this->description) ? 'hasTip' : '';
     $class = $this->required == true ? $class . ' required' : $class;
     $req = $this->required == true ? '<span class="star">&#160;*</span>' : '';
     // Add the opening label tag and main attributes attributes.
     $label .= '<label id="' . $this->id . '-lbl" for="' . $this->id . '" class="' . $class . '"';
     // If a description is specified, use it to build a tooltip.
     if (!empty($this->description)) {
         $label .= ' title="' . htmlspecialchars(trim(JText::_($text), ':') . '::' . JText::_($this->description), ENT_COMPAT, 'UTF-8') . '"';
     }
     // Add the label text and closing tag.
     $label .= '>' . JText::_($text) . $req . '</label>';
     return $label;
 }
예제 #8
0
 /**
  * Test the _ method.
  *
  * @return  void
  *
  * @since   11.1
  */
 public function test_()
 {
     // Add the include path to html test files.
     JHtml::addIncludePath(array(__DIR__ . '/html/testfiles'));
     // Test the class method was called and the arguments passed correctly.
     $this->assertThat(JHtml::_('inspector.method1', 'argument1', 'argument2'), $this->equalTo('JHtmlInspector::method1'), 'JHtmlInspector::method1 could not be called.');
     $this->assertThat(JHtmlInspector::$arguments[0], $this->equalTo(array('argument1', 'argument2')), 'The arguments where not correctly passed to JHtmlInspector::method1.');
     // Test error cases.
     // Prepare the error handlers.
     $this->saveErrorHandlers();
     $errorCallback = $this->getMock('errorCallback', array('error1', 'error2', 'error3'));
     $errorCallback->expects($this->once())->method('error1');
     $errorCallback->expects($this->once())->method('error2');
     $errorCallback->expects($this->once())->method('error3');
     // Ensure that we get an error if we can find the file but the file does not contain the class.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error1'));
     $this->assertThat(JHtml::_('empty.anything'), $this->isFalse());
     // Ensure that we get an error if we can't find the file.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error2'));
     $this->assertThat(JHtml::_('nofile.anything'), $this->isFalse());
     // Ensure that we get an error if we have the class but not the method.
     JError::setErrorHandling(E_ERROR, 'callback', array($errorCallback, 'error3'));
     $this->assertThat(JHtml::_('inspector.nomethod'), $this->isFalse());
     // Restore the error handlers.
     $this->setErrorHandlers($this->savedErrorState);
 }
예제 #9
0
 /**
  * Display the view
  *
  * @param   string $tpl The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->getConfig();
     foreach ($this->items as $i => $item) {
         $this->items[$i]->params = json_decode($item->advancedparams);
         if (is_null($this->items[$i]->params)) {
             $this->items[$i]->params = new stdClass();
         }
     }
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Check if there are no matching items
     if (!count($this->items)) {
         JFactory::getApplication()->enqueueMessage(JText::_('COM_MODULES_MSG_MANAGE_NO_MODULES'), 'warning');
     }
     $this->addToolbar();
     // Include the component HTML helpers.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     parent::display($tpl);
 }
예제 #10
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise an Error object.
  *
  * @since   1.6
  */
 public function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // We don't need the toolbar in the modal window.
     if ($this->getLayout() !== 'modal') {
         $this->addToolbar();
     } else {
         // Client id selector should not exist.
         $this->filterForm->removeField('client_id', '');
         // If in the frontend state and language should not activate the search tools.
         if (JFactory::getApplication()->isSite()) {
             unset($this->activeFilters['state']);
             unset($this->activeFilters['language']);
         }
     }
     // Include the component HTML helpers.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     return parent::display($tpl);
 }
예제 #11
0
 function config()
 {
     jimport('joomla.html.editor');
     JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'htmlelements');
     $model = JModel::getInstance('Comission', 'J' . APP_PREFIX . 'PricingModel');
     $r = $model->getItemPrices($this->commissionType);
     JModel::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'thefactory' . DS . 'category' . DS . 'models');
     $catModel = JModel::getInstance('Category', 'JTheFactoryModel');
     $cattree = $catModel->getCategoryTree();
     $pricing = $model->loadPricingObject();
     $params = new JParameter($pricing->params);
     $editor = JFactory::getEditor();
     $viewMenu = $this->getView('menu');
     $viewMenu->display();
     $view = $this->getView('Config');
     $view->assign('default_price', $r->default_price);
     $view->assign('price_powerseller', $r->price_powerseller);
     $view->assign('price_verified', $r->price_verified);
     $view->assign('category_pricing_enabled', $r->category_pricing_enabled);
     $view->assign('category_pricing', $r->category_pricing);
     $view->assign('category_tree', $cattree);
     $view->assign('itemname', $this->itemname);
     $view->assign('editor', $editor);
     $view->assign('email_text', base64_decode($params->get('email_text')));
     $view->display();
 }
예제 #12
0
 function display($tpl = null)
 {
     require_once JPATH_COMPONENT . '/helpers/jcomments.php';
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $filter_state = $this->state->get('filter.state');
     // Filter by published state
     $filter_state_options = array();
     $filter_state_options[] = JHTML::_('select.option', '1', JText::_('A_FILTER_STATE_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', '0', JText::_('A_FILTER_STATE_UNPUBLISHED'));
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('jcomments.stylesheet');
     // Use frontend template's stylesheet for icons
     $document = JFactory::getDocument();
     $document->addStylesheet(JURI::root(true) . '/components/com_jcomments/tpl/default/style.css?v=3002', 'text/css', null);
     if (version_compare(JVERSION, '3.0', 'ge')) {
         JHtml::_('bootstrap.tooltip');
         JHtml::_('formbehavior.chosen', 'select');
         JCommentsHelper::addSubmenu('custombbcodes');
         JHtmlSidebar::setAction('index.php?option=com_jcomments&view=custombbcodes');
         JHtmlSidebar::addFilter(JText::_('A_FILTER_STATE'), 'filter_state', JHtml::_('select.options', $filter_state_options, 'value', 'text', $filter_state, true));
         $this->bootstrap = true;
         $this->sidebar = JHtmlSidebar::render();
     } else {
         JCommentsHelper::addSubmenu('custombbcodes');
         array_unshift($filter_state_options, JHTML::_('select.option', '', JText::_('A_FILTER_STATE')));
         $filter = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', 'onchange="Joomla.submitform();"', 'value', 'text', $filter_state);
         $this->assignRef('filter', $filter);
     }
     $this->addToolbar();
     // Include the component HTML helpers.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     parent::display($tpl);
 }
예제 #13
0
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     include JPATH_COMPONENT . '/helpers/toolbar.php';
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = SolidresHelper::getActions('', $this->item->id);
     if ($isNew) {
         JToolBarHelper::title(JText::_('SR_ADD_NEW_ROOM_TYPE'), 'generic.png');
     } else {
         JToolBarHelper::title(JText::sprintf('SR_EDIT_ROOM_TYPE', $this->item->name), 'generic.png');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('behavior.tooltip');
     SRHtml::_('jquery.validate');
     // If not checked out, can save the item.
     if (!$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('roomtype.apply', 'JToolbar_Apply');
         JToolBarHelper::save('roomtype.save', 'JToolbar_Save');
         JToolBarHelper::addNew('roomtype.save2new', 'JToolbar_Save_and_new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('roomtype.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('roomtype.cancel', 'JToolbar_Cancel');
     } else {
         JToolBarHelper::cancel('roomtype.cancel', 'JToolbar_Close');
     }
     SRToolBarHelper::mediaManager();
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.roomtype.edit', 'JTOOLBAR_HELP');
 }
예제 #14
0
 /**
  * @todo Implement test_().
  */
 public function test_()
 {
     // first we test to ensure that if a handler is properly registered, it gets called
     $registered = $this->getMock('MyHtmlClass', array('mockFunction'));
     // test that we can register the method
     JHtml::register('file.testfunction', array($registered, 'mockFunction'));
     // test that calling _ actually calls the function
     $registered->expects($this->once())->method('mockFunction')->with('Test Return Value')->will($this->returnValue('My Expected Return Value'));
     $this->assertThat(JHtml::_('file.testfunction', 'Test Return Value'), $this->equalTo('My Expected Return Value'));
     // we unregister the method to return to our original state
     JHtml::unregister('prefix.file.testfunction');
     // now we test with a class that will be found in the expected file
     JHtml::addIncludePath(array(JPATH_BASE . '/tests/unit/suite/libraries/joomla/html/htmltests'));
     $this->assertThat(JHtml::_('mocktest.method1', 'argument1', 'argument2'), $this->equalTo('JHtml Mock Called'));
     $this->assertThat(JHtmlMockTest::$arguments[0], $this->equalTo(array('argument1', 'argument2')));
     JHtmlMockTest::$arguments = array();
     $this->saveErrorHandlers();
     $mock1 = $this->getMock('errorCallback', array('error1', 'error2', 'error3'));
     JError::setErrorHandling(E_ERROR, 'callback', array($mock1, 'error1'));
     $mock1->expects($this->once())->method('error1');
     // we ensure that we get an error if we can find the file but the file does not contain the class
     $this->assertThat(JHtml::_('mocktest2.function1'), $this->isFalse());
     JError::setErrorHandling(E_ERROR, 'callback', array($mock1, 'error2'));
     $mock1->expects($this->once())->method('error2');
     // we ensure that we get an error if we can't find the file
     $this->assertThat(JHtml::_('mocktestnotthere.function1'), $this->isFalse());
     JError::setErrorHandling(E_ERROR, 'callback', array($mock1, 'error3'));
     $mock1->expects($this->once())->method('error3');
     // we ensure that we get an error if we have the class but not the method
     $this->assertThat(JHtml::_('mocktest.nomethod'), $this->isFalse());
     // restore our error handlers
     $this->setErrorHandlers($this->savedErrorState);
 }
예제 #15
0
 /**
  * Установки тулбара
  */
 protected function _setToolBar()
 {
     require_once JPATH_COMPONENT . '/helpers/smfaq.php';
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     SmFaqHelper::addSubmenu($this->_name);
     $canDo = SmFaqHelper::getActions($this->state->get('filter.category_id'));
     // Выводим нужные кнопки и заголовок
     JToolBarHelper::title(JText::_('COM_SMFAQ_MANAGER_QUESTIONS'), 'smfaq');
     if ($canDo->get('core.create')) {
         JToolBarHelper::addNewX('smfaq.add', 'JTOOLBAR_NEW');
     }
     if ($canDo->get('core.edit')) {
         JToolBarHelper::editListX('smfaq.edit', 'JTOOLBAR_EDIT');
     }
     JToolBarHelper::divider();
     JToolBarHelper::custom('smfaqlist.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
     JToolBarHelper::custom('smfaqlist.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
     JToolBarHelper::divider();
     JToolBarHelper::checkin('smfaqlist.checkin');
     // Замена тулбара карзины на удаление
     if ($this->state->get('filter.published') == -2) {
         JToolBarHelper::deleteList('COM_SMFAQ_YOU_WANT_DELETE_THIS', 'smfaqlist.delete', 'JTOOLBAR_EMPTY_TRASH');
     } else {
         JToolBarHelper::trash('smfaqlist.trash', 'JTOOLBAR_TRASH');
     }
     JToolBarHelper::divider();
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_smfaq');
     }
 }
예제 #16
0
 function display($tpl = null)
 {
     require_once JPATH_COMPONENT . '/helpers/jcomments.php';
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->liveSmiliesPath = str_replace('\\', '/', JCommentsHelper::getSmiliesPath());
     $filter_state = $this->state->get('filter.state');
     // Filter by published state
     $filter_state_options = array();
     $filter_state_options[] = JHTML::_('select.option', '1', JText::_('A_FILTER_STATE_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', '0', JText::_('A_FILTER_STATE_UNPUBLISHED'));
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('jcomments.stylesheet');
     if (version_compare(JVERSION, '3.0', 'ge')) {
         JHtml::_('bootstrap.tooltip');
         JHtml::_('formbehavior.chosen', 'select');
         JCommentsHelper::addSubmenu('smilies');
         JHtmlSidebar::setAction('index.php?option=com_jcomments&view=smilies');
         JHtmlSidebar::addFilter(JText::_('A_FILTER_STATE'), 'filter_state', JHtml::_('select.options', $filter_state_options, 'value', 'text', $filter_state, true));
         $this->bootstrap = true;
         $this->sidebar = JHtmlSidebar::render();
     } else {
         JCommentsHelper::addSubmenu('smilies');
         array_unshift($filter_state_options, JHTML::_('select.option', '', JText::_('A_FILTER_STATE')));
         $filter = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', 'onchange="Joomla.submitform();"', 'value', 'text', $filter_state);
         $this->assignRef('filter', $filter);
     }
     $this->addToolbar();
     // Include the component HTML helpers.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     parent::display($tpl);
 }
예제 #17
0
 /**
  * Override the display method for the view.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Initialise view variables.
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->user = $this->get('User');
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
     UsersHelper::addSubmenu('notes');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         throw new Exception(implode("\n", $errors), 500);
     }
     // Get the component HTML helpers
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Turn parameters into registry objects
     foreach ($this->items as $item) {
         $item->cparams = new Registry();
         $item->cparams->loadString($item->category_params);
     }
     $this->addToolbar();
     $this->sidebar = JHtmlSidebar::render();
     parent::display($tpl);
 }
예제 #18
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     include JPATH_COMPONENT . '/helpers/toolbar.php';
     $isNew = $this->item->id == 0;
     $canDo = SolidresHelper::getActions('', $this->item->id);
     if ($isNew) {
         JToolBarHelper::title(JText::_('SR_ADD_NEW_EXTRA'), 'generic.png');
     } else {
         JToolBarHelper::title(JText::sprintf('SR_EDIT_EXTRA', $this->item->name), 'generic.png');
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('behavior.tooltip');
     //JHtml::_('behavior.formvalidation');
     SRHtml::_('jquery.validate');
     //echo SolidresHelperSideNavigation::getSideNavigation($this->getName());
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('extra.apply', 'JToolbar_Apply');
         JToolBarHelper::save('extra.save', 'JToolbar_Save');
         JToolBarHelper::addNew('extra.save2new', 'JToolbar_Save_and_new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::custom('extra.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false);
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('extra.cancel', 'JToolbar_Cancel');
     } else {
         JToolBarHelper::cancel('extra.cancel', 'JToolbar_Close');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('screen.extra.edit', 'JTOOLBAR_HELP');
 }
예제 #19
0
    public function display($tmpl = null)
    {
		$app	= JFactory::getApplication();
		$params = $app->getParams();
		if (!$this->smarty->get_template_vars('page_title') && $params->get('show_page_title', 1))
        {
			$page_title = $this->escape($params->get('page_title'));
			if($page_title)
            {
                $this->smarty->assign("page_title", $page_title);
            }
		}
       
		//add alternate feed link
		if($params->get('show_feed_link', 1) && file_exists(dirname(__FILE__).'view.feed.php'))
		{
			$document = JFactory::getDocument();
			$link	= '&format=feed&limitstart=';
			$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
			$document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
			$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
			$document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
		}

        $MyApp = JTheFactoryApplication::getInstance();
        if($MyApp->getIniValue('use_custom_fields')) {
            JHtml::addIncludePath($MyApp->app_path_admin.DS."fields".DS."html");
        }

        $this->smarty->display($tmpl);
    }
예제 #20
0
 function display($tpl = null)
 {
     require_once JPATH_COMPONENT . '/helpers/jcomments.php';
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $filter_object_group = $this->state->get('filter.object_group');
     $filter_language = $this->state->get('filter.language');
     $filter_state = $this->state->get('filter.state');
     // Filter by published state
     $filter_state_options = array();
     $filter_state_options[] = JHTML::_('select.option', '1', JText::_('A_FILTER_STATE_PUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', '0', JText::_('A_FILTER_STATE_UNPUBLISHED'));
     $filter_state_options[] = JHTML::_('select.option', '2', JText::_('A_FILTER_STATE_REPORTED'));
     // Filter by component (object_group)
     $filter_object_group_options = array();
     $object_groups = $this->get('FilterObjectGroups');
     foreach ($object_groups as $object_group) {
         $filter_object_group_options[] = JHTML::_('select.option', $object_group->name, $object_group->name);
     }
     // Filter by language
     $filter_language_options = array();
     $languages = $this->get('FilterLanguages');
     foreach ($languages as $language) {
         $filter_language_options[] = JHTML::_('select.option', $language->name, $language->name);
     }
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     JHtml::_('jcomments.stylesheet');
     if (version_compare(JVERSION, '3.0', 'ge')) {
         JHtml::_('bootstrap.tooltip');
         JHtml::_('formbehavior.chosen', 'select');
         JCommentsHelper::addSubmenu('comments');
         JHtmlSidebar::setAction('index.php?option=com_jcomments&view=comments');
         JHtmlSidebar::addFilter(JText::_('A_FILTER_STATE'), 'filter_state', JHtml::_('select.options', $filter_state_options, 'value', 'text', $filter_state, true));
         if (count($filter_object_group_options)) {
             JHtmlSidebar::addFilter(JText::_('A_FILTER_COMPONENT'), 'filter_object_group', JHtml::_('select.options', $filter_object_group_options, 'value', 'text', $filter_object_group, true));
         }
         if (count($filter_language_options)) {
             JHtmlSidebar::addFilter(JText::_('A_FILTER_LANGUAGE'), 'filter_language', JHtml::_('select.options', $filter_language_options, 'value', 'text', $filter_language, true));
         }
         $this->bootstrap = true;
         $this->sidebar = JHtmlSidebar::render();
     } else {
         JCommentsHelper::addSubmenu('comments');
         $filter = '';
         array_unshift($filter_state_options, JHTML::_('select.option', '', JText::_('A_FILTER_STATE')));
         $filter .= JHTML::_('select.genericlist', $filter_state_options, 'filter_state', 'onchange="Joomla.submitform();"', 'value', 'text', $filter_state);
         if (count($filter_object_group_options)) {
             array_unshift($filter_object_group_options, JHTML::_('select.option', '', JText::_('A_FILTER_COMPONENT')));
             $filter .= ' ' . JHTML::_('select.genericlist', $filter_object_group_options, 'filter_object_group', 'onchange="Joomla.submitform();"', 'value', 'text', $filter_object_group);
         }
         if (count($filter_language_options)) {
             array_unshift($filter_language_options, JHTML::_('select.option', '', JText::_('A_FILTER_LANGUAGE')));
             $filter .= ' ' . JHTML::_('select.genericlist', $filter_language_options, 'filter_language', 'onchange="Joomla.submitform();"', 'value', 'text', $filter_language);
         }
         $this->assignRef('filter', $filter);
     }
     $this->addToolbar();
     parent::display($tpl);
 }
예제 #21
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  JError object on failure, void on success.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $params = $app->getParams();
     // Get view data.
     $state = $this->get('State');
     $query = $this->get('Query');
     JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderQuery') : null;
     $results = $this->get('Results');
     JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderResults') : null;
     $total = $this->get('Total');
     JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderTotal') : null;
     $pagination = $this->get('Pagination');
     JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderPagination') : null;
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     // Configure the pathway.
     if (!empty($query->input)) {
         $app->getPathWay()->addItem($this->escape($query->input));
     }
     // Push out the view data.
     $this->state =& $state;
     $this->params =& $params;
     $this->query =& $query;
     $this->results =& $results;
     $this->total =& $total;
     $this->pagination =& $pagination;
     // Check for a double quote in the query string.
     if (strpos($this->query->input, '"')) {
         // Get the application router.
         $router =& $app::getRouter();
         // Fix the q variable in the URL.
         if ($router->getVar('q') !== $this->query->input) {
             $router->setVar('q', $this->query->input);
         }
     }
     // Log the search
     JSearchHelper::logSearch($this->query->input, 'com_finder');
     // Push out the query data.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     $this->suggested = JHtml::_('query.suggested', $query);
     $this->explained = JHtml::_('query.explained', $query);
     // Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     // Check for layout override only if this is not the active menu item
     // If it is the active menu item, then the view and category id will match
     $active = $app->getMenu()->getActive();
     if (isset($active->query['layout'])) {
         // We need to set the layout in case this is an alternative menu item (with an alternative layout)
         $this->setLayout($active->query['layout']);
     }
     $this->prepareDocument($query);
     JDEBUG ? $GLOBALS['_PROFILER']->mark('beforeFinderLayout') : null;
     parent::display($tpl);
     JDEBUG ? $GLOBALS['_PROFILER']->mark('afterFinderLayout') : null;
 }
예제 #22
0
 protected function getOptions()
 {
     JHtml::addIncludePath(JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_cobalt' . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . 'html');
     $key = $this->element['key'] ? $this->element['key'] : 'key';
     $select = $this->multiple || $this->element['multi'] ? false : true;
     $sections = JHtml::_('cobalt.types', $select, $this->element['filters'], $key, $this->element['client']);
     return $sections;
 }
예제 #23
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Include the component HTML helpers.
     $this->_path['template'] = array(JPATH_ROOT . '/plugins/system/jsnframework/libraries/joomlashine/menutypes/tmpl');
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Load assets
     JSNBaseHelper::loadAssets();
     parent::display($tpl);
 }
예제 #24
0
 /**
  * Method to display the view.
  *
  * @param   string  $tpl  A template file to load. [optional]
  *
  * @return  mixed  JError object on failure, void on success.
  *
  * @since   2.5
  */
 public function display($tpl = null)
 {
     // Get the application
     $app = JFactory::getApplication();
     // Adjust the list limit to the feed limit.
     $app->input->set('limit', $app->getCfg('feed_limit'));
     // Get view data.
     $state = $this->get('State');
     $params = $state->get('params');
     $query = $this->get('Query');
     $results = $this->get('Results');
     // Push out the query data.
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     $suggested = JHtml::_('query.suggested', $query);
     $explained = JHtml::_('query.explained', $query);
     // Set the document title.
     $title = $params->get('page_title', '');
     if (empty($title)) {
         $title = $app->getCfg('sitename');
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
     } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
     }
     $this->document->setTitle($title);
     // Configure the document description.
     if (!empty($explained)) {
         $this->document->setDescription(html_entity_decode(strip_tags($explained), ENT_QUOTES, 'UTF-8'));
     }
     // Set the document link.
     $this->document->link = JRoute::_($query->toURI());
     // If we don't have any results, we are done.
     if (empty($results)) {
         return;
     }
     // Convert the results to feed entries.
     foreach ($results as $result) {
         // Convert the result to a feed entry.
         $item = new JFeedItem();
         $item->title = $result->title;
         $item->link = JRoute::_($result->route);
         $item->description = $result->description;
         $item->date = intval($result->start_date) ? JHtml::date($result->start_date, 'l d F Y') : $result->indexdate;
         // Get the taxonomy data.
         $taxonomy = $result->getTaxonomy();
         // Add the category to the feed if available.
         if (isset($taxonomy['Category'])) {
             $node = array_pop($taxonomy['Category']);
             $item->category = $node->title;
         }
         // Loads item info into rss array.
         $this->document->addItem($item);
     }
 }
예제 #25
0
 public function initialize()
 {
     JHtml::addIncludePath(JUri::root(true) . '/libraries/html/html');
     // Add JavaScript Frameworks
     JHtml::_('moobootstrap.framework');
     $this->compileLess("kunena.less", "bootstrap-custom.css");
     $document = JFactory::getDocument();
     $document->addStyleSheet(JUri::root(true) . '/media/kunena/css/joomla25/bootstrap-custom.css');
     $document->addStyleSheet(JUri::base(true) . '/components/com_kunena/media/css/joomla25/layout.css');
     $document->addStyleSheet(JUri::base(true) . '/components/com_kunena/media/css/joomla25/styles.css');
     $document->addScript(JUri::root(true) . '/media/kunena/js/bootstrap/moobootstrap.js');
 }
예제 #26
0
 /**
  * Method to display a view.
  *
  * @param   boolean  $cachable   If true, the view output will be cached
  * @param   array    $urlparams  An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return  JController  This object to support chaining.
  *
  * @since   1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Get the current URI to redirect to.
     $uri = JURI::getInstance();
     $redirect = base64_encode($uri);
     // Get the document object.
     $document = JFactory::getDocument();
     // Set the default view name and format from the Request.
     if (file_exists(JPATH_CONFIGURATION . '/configuration.php') && filesize(JPATH_CONFIGURATION . '/configuration.php') > 10 && file_exists(JPATH_INSTALLATION . '/index.php')) {
         $default_view = 'remove';
     } else {
         $default_view = 'site';
     }
     $vName = $this->input->getWord('view', $default_view);
     $vFormat = $document->getType();
     $lName = $this->input->getWord('layout', 'default');
     if (strcmp($vName, $default_view) == 0) {
         $this->input->set('view', $default_view);
     }
     $view = $this->getView($vName, $vFormat);
     if ($view) {
         $model = $this->getModel('Setup', 'InstallationModel', array('dbo' => null));
         $sufficient = $model->getPhpOptionsSufficient();
         switch ($vName) {
             case 'preinstall':
                 $checkOptions = false;
                 if ($sufficient) {
                     $this->setRedirect('index.php');
                 }
                 break;
             default:
                 $checkOptions = true;
                 if (!$sufficient) {
                     $this->setRedirect('index.php?view=preinstall');
                 }
                 break;
         }
         $options = $model->getOptions();
         if ($vName != $default_view && ($checkOptions && empty($options))) {
             $this->setRedirect('index.php');
         }
         // Push the model into the view (as default).
         $view->setModel($model, true);
         $view->setLayout($lName);
         // Push document object into the view.
         $view->document = $document;
         // Include the component HTML helpers.
         JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
         $view->display();
     }
     return $this;
 }
예제 #27
0
 function config()
 {
     JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'htmlelements');
     $model = JModel::getInstance('Contact', 'J' . APP_PREFIX . 'PricingModel');
     $r = $model->getItemPrices();
     $view = $this->getView('Config', 'html', 'JBidPricingViewContact');
     $view->assign('currency', $r->default_currency);
     $view->assign('default_price', $r->default_price);
     $view->assign('price_powerseller', $r->price_powerseller);
     $view->assign('price_verified', $r->price_verified);
     $view->assign('itemname', $this->itemname);
     $view->display();
 }
예제 #28
0
 protected function getOptions()
 {
     JHtml::addIncludePath(JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator' . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_cobalt' . DIRECTORY_SEPARATOR . 'library' . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR . 'html');
     $sections = JHtml::_('cobalt.sections');
     $options = array();
     if ($this->element['select'] == 1) {
         $options[] = JHTML::_('select.option', '', JText::_('- Select Section -'));
     }
     foreach ($sections as $type) {
         $options[] = JHTML::_('select.option', $type->value, $type->text);
     }
     return $options;
 }
예제 #29
0
 /**
  * Display the view
  *
  * @param   string  $tpl  The name of the template file to parse.
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Include the component HTML helpers.
     if (!JFactory::getUser()->authorise('core.manage', 'com_users')) {
         return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Include the component HTML helpers.
     $this->_path['template'] = array(JPATH_ROOT . '/plugins/system/jsnframework/libraries/joomlashine/users/tmpl');
     JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
     // Load assets
     JSNBaseHelper::loadAssets();
     parent::display($tpl);
     echo JSNHtmlAsset::loadScript('jsn/selectorFilter', array(), true);
 }
예제 #30
0
 /**
  * Constructor
  *
  * @return  void
  * @since   1.5.5
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->_ambit = JoomAmbit::getInstance();
     $this->_config = JoomConfig::getInstance();
     $this->_mainframe = JFactory::getApplication('site');
     $this->_user = JFactory::getUser();
     $this->_doc = JFactory::getDocument();
     JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/helpers/html');
     // If we are just displaying an image we don't need anything else
     if (JRequest::getCmd('format') == 'raw' || JRequest::getCmd('format') == 'jpg' || JRequest::getCmd('format') == 'json' || JRequest::getCmd('format') == 'feed') {
         return;
     }
     // Add the CSS file generated from backend settings
     $this->_doc->addStyleSheet($this->_ambit->getStyleSheet($this->_config->getStyleSheetName()));
     // Add the main CSS file
     $this->_doc->addStyleSheet($this->_ambit->getStyleSheet('joomgallery.css'));
     // Add the RTL CSS file if an RTL language is used
     if (JFactory::getLanguage()->isRTL()) {
         $this->_doc->addStyleSheet($this->_ambit->getStyleSheet('joomgallery_rtl.css'));
     }
     // Add individual CSS file if it exists
     if (file_exists(JPATH_ROOT . '/media/joomgallery/css/joom_local.css')) {
         $this->_doc->addStyleSheet($this->_ambit->getStyleSheet('joom_local.css'));
     }
     $pngbehaviour = "  <!-- Do not edit IE conditional style below -->" . "\n" . "  <!--[if lte IE 6]>" . "\n" . "  <style type=\"text/css\">\n" . "    .pngfile {\n" . "      behavior:url('" . JURI::root() . "media/joomgallery/js/pngbehavior.htc') !important;\n" . "    }\n" . "  </style>\n" . "  <![endif]-->" . "\n" . "  <!-- End Conditional Style -->";
     $this->_doc->addCustomTag($pngbehaviour);
     // Set documents meta data taken from menu entry definition
     $params = $this->_mainframe->getParams();
     if ($params->get('menu-meta_description')) {
         $this->_doc->setDescription($params->get('menu-meta_description'));
     }
     if ($params->get('menu-meta_keywords')) {
         $this->_doc->setMetadata('keywords', $params->get('menu-meta_keywords'));
     }
     if ($params->get('robots')) {
         $this->_doc->setMetadata('robots', $params->get('robots'));
     }
     // Page title
     $pagetitle = JoomHelper::addSitenameToPagetitle($this->_doc->getTitle());
     $this->_doc->setTitle($pagetitle);
     // Check for alternative layout only if this is not the active menu item
     $active = $this->_mainframe->getMenu()->getActive();
     if (!$active || strpos($active->link, 'view=' . $this->getName()) === false) {
         // Get the default layout from the configuration
         if ($layout = $this->_config->get('jg_alternative_layout')) {
             $this->setLayout($layout);
         }
     }
 }