Exemplo n.º 1
0
 public static function createStatuses()
 {
     $app = JFactory::getApplication();
     $filter_steps = $app->getUserStateFromRequest('com_imc.issues.filter.steps', 'steps', array());
     //get issue statuses
     JFormHelper::addFieldPath(JPATH_ROOT . '/components/com_imc/models/fields');
     $step = JFormHelper::loadFieldType('Step', false);
     $statuses = $step->getOptions();
     if (empty($filter_steps)) {
         $str = '<ul class="imc_ulist imc_ulist_inline">';
         foreach ($statuses as $status) {
             $str .= '<li>';
             $str .= '<input type="checkbox" name="steps[]" value="' . $status->value . '" ' . 'checked="checked"' . '>';
             $str .= '<span class="root">' . ' ' . $status->text . '</span>';
             $str .= '</li>';
         }
         $str .= '</ul>';
     } else {
         $str = '<ul class="imc_ulist imc_ulist_inline">';
         foreach ($statuses as $status) {
             $str .= '<li>';
             $str .= '<input type="checkbox" name="steps[]" value="' . $status->value . '" ' . (in_array($status->value, $filter_steps) ? 'checked="checked"' : '') . '>';
             $str .= '<span class="root">' . ' ' . $status->text . '</span>';
             $str .= '</li>';
         }
         $str .= '</ul>';
     }
     return $str;
 }
Exemplo n.º 2
0
 function display($tpl = null)
 {
     JFormHelper::addFormPath(JPATH_ADMINISTRATOR . '/components/com_j2store/models/forms');
     JFormHelper::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_j2store/models/fields');
     $this->form = JForm::getInstance('storeprofile', 'storeprofile');
     $this->addToolBar();
     parent::display();
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
 public function __construct(&$subject, $config)
 {
     if (!class_exists('joomlamailerMCAPI')) {
         return;
     }
     parent::__construct($subject, $config);
     JFormHelper::addFieldPath(__DIR__ . '/fields');
     $this->api = $this->getApiInstance();
     $this->debug = JFactory::getConfig()->get('debug');
     $this->listId = $this->params->get('listid');
 }
 protected function populateState($ordering = null, $direction = null)
 {
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     $published = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
     $this->setState('filter.state', $published);
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     $catID = $this->getUserStateFromRequest($this->context . '.filter.category', 'filter_category');
     $this->setState('filter.category', $catID);
     $visibility = $this->getUserStateFromRequest($this->context . '.filter.visibility', 'filter_visibility');
     $this->setState('filter.category', $visibility);
     parent::populateState('a.ordering', 'asc');
 }
Exemplo n.º 6
0
 /**
  * Method to register custom library.
  *
  * @return  void
  */
 public function onAfterInitialise()
 {
     if (!$this->isRedcoreComponent()) {
         return;
     }
     $redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
     if (file_exists($redcoreLoader)) {
         require_once $redcoreLoader;
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
         }
     }
     // Make available the fields
     JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields');
     // Make available the rules
     JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules');
 }
Exemplo n.º 7
0
 /**
  * Method to register custom library.
  *
  * @return  void
  */
 public function onAfterInitialise()
 {
     $isAdmin = JFactory::getApplication()->isAdmin();
     if (!$isAdmin || !$this->isRedradComponent()) {
         return;
     }
     $redradLoader = JPATH_LIBRARIES . '/redrad/bootstrap.php';
     if (file_exists($redradLoader) && !class_exists('Inflector')) {
         require_once $redradLoader;
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redrad/joomla', false, true);
         }
     }
     // Make available the fields
     JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redrad/form/fields');
     // Make available the rules
     JFormHelper::addRulePath(JPATH_LIBRARIES . '/redrad/form/rules');
 }
Exemplo n.º 8
0
 /**
  * $type, $domId, $value, $options = array(), $formName = null, $disabled = false
  */
 public static function element()
 {
     list($type, $domId, $value, $options) = func_get_args();
     $options = (array) $options;
     // Load the JFormField object for the field.
     JFormHelper::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models' . DS . 'fields');
     $field = JFormHelper::loadFieldType($type, true);
     // If the object could not be loaded, get a text field object.
     if ($field === false) {
         throw new Exception('Cannot load field type ' . $type);
     }
     $element = new JXMLElement('<field></field>');
     $element->addAttribute('id', $domId);
     if (!empty($options)) {
         foreach ($options as $name => $val) {
             $element->addAttribute($name, $val);
         }
     }
     if (!$field->setup($element, $value, null)) {
         throw new Exception('Cannot setup field ' . $type);
     }
     return $field->input;
 }
Exemplo n.º 9
0
 /**
  * Just an idea, still WIP
  * @param $type
  * @return mixed
  */
 static function renderFormField($type)
 {
     //Get custom field
     JFormHelper::addFieldPath(VMPATH_ADMIN . DS . 'fields');
     $types = JFormHelper::loadFieldType($type, false);
     return $types->getOptions();
 }
Exemplo n.º 10
0
 /**
  * Effectively bootstrap redCORE.
  *
  * @param   bool  $loadBootstrap  Load bootstrap with redcore plugin options
  *
  * @return  void
  */
 public static function bootstrap($loadBootstrap = true)
 {
     if ($loadBootstrap && !defined('REDCORE_BOOTSTRAPPED')) {
         define('REDCORE_BOOTSTRAPPED', 1);
     }
     if (!defined('REDCORE_LIBRARY_LOADED')) {
         // Sets bootstrapped variable, to avoid bootstrapping redCORE twice
         define('REDCORE_LIBRARY_LOADED', 1);
         // Use our own base field
         if (!class_exists('JFormField', false)) {
             $baseField = JPATH_LIBRARIES . '/redcore/joomla/form/field.php';
             if (file_exists($baseField)) {
                 require_once $baseField;
             }
         }
         // Register the classes for autoload.
         JLoader::registerPrefix('R', JPATH_REDCORE);
         // Setup the RLoader.
         RLoader::setup();
         // Make available the redCORE fields
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/field');
         JFormHelper::addFieldPath(JPATH_REDCORE . '/form/fields');
         // Make available the redCORE form rules
         JFormHelper::addRulePath(JPATH_REDCORE . '/form/rules');
         // HTML helpers
         JHtml::addIncludePath(JPATH_REDCORE . '/html');
         RHtml::addIncludePath(JPATH_REDCORE . '/html');
         // Load library language
         $lang = JFactory::getLanguage();
         $lang->load('lib_redcore', JPATH_REDCORE);
         // For Joomla! 2.5 compatibility we add some core functions
         if (version_compare(JVERSION, '3.0', '<')) {
             RLoader::registerPrefix('J', JPATH_LIBRARIES . '/redcore/joomla', false, true);
         }
         // Make available the fields
         JFormHelper::addFieldPath(JPATH_LIBRARIES . '/redcore/form/fields');
         // Make available the rules
         JFormHelper::addRulePath(JPATH_LIBRARIES . '/redcore/form/rules');
         // Replaces Joomla database driver for redCORE database driver
         JFactory::$database = null;
         JFactory::$database = RFactory::getDbo();
         if (self::getConfig('enable_translations', 0) == 1 && !JFactory::getApplication()->isAdmin()) {
             // This is our object now
             $db = JFactory::getDbo();
             // Enable translations
             $db->translate = self::getConfig('enable_translations', 0) == 1;
             // Reset plugin translations params if needed
             RTranslationHelper::resetPluginTranslation();
         }
     }
 }
Exemplo n.º 11
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JToolBarHelper::title(JText::_('COM_COSTBENEFITPROJECTION_CURRENCIES'), 'credit');
     JHtmlSidebar::setAction('index.php?option=com_costbenefitprojection&view=currencies');
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     if ($this->canCreate) {
         JToolBarHelper::addNew('currency.add');
     }
     // Only load if there are items
     if (CostbenefitprojectionHelper::checkArray($this->items)) {
         if ($this->canEdit) {
             JToolBarHelper::editList('currency.edit');
         }
         if ($this->canState) {
             JToolBarHelper::publishList('currencies.publish');
             JToolBarHelper::unpublishList('currencies.unpublish');
             JToolBarHelper::archiveList('currencies.archive');
             if ($this->canDo->get('core.admin')) {
                 JToolBarHelper::checkin('currencies.checkin');
             }
         }
         // Add a batch button
         if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) {
             // Get the toolbar object instance
             $bar = JToolBar::getInstance('toolbar');
             // set the batch button name
             $title = JText::_('JTOOLBAR_BATCH');
             // Instantiate a new JLayoutFile instance and render the batch button
             $layout = new JLayoutFile('joomla.toolbar.batch');
             // add the button to the page
             $dhtml = $layout->render(array('title' => $title));
             $bar->appendButton('Custom', $dhtml, 'batch');
         }
         if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) {
             JToolbarHelper::deleteList('', 'currencies.delete', 'JTOOLBAR_EMPTY_TRASH');
         } elseif ($this->canState && $this->canDelete) {
             JToolbarHelper::trash('currencies.trash');
         }
         if ($this->canDo->get('core.export') && $this->canDo->get('currency.export')) {
             JToolBarHelper::custom('currencies.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true);
         }
     }
     if ($this->canDo->get('core.import') && $this->canDo->get('currency.import')) {
         JToolBarHelper::custom('currencies.importData', 'upload', '', 'COM_COSTBENEFITPROJECTION_IMPORT_DATA', false);
     }
     // set help url for this view if found
     $help_url = CostbenefitprojectionHelper::getHelpUrl('currencies');
     if (CostbenefitprojectionHelper::checkString($help_url)) {
         JToolbarHelper::help('COM_COSTBENEFITPROJECTION_HELP_MANAGER', false, $help_url);
     }
     // add the options comp button
     if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) {
         JToolBarHelper::preferences('com_costbenefitprojection');
     }
     if ($this->canState) {
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
         // only load if batch allowed
         if ($this->canBatch) {
             JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true));
         }
     }
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     if ($this->canBatch && $this->canCreate && $this->canEdit) {
         JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text'));
     }
 }
Exemplo n.º 12
0
 /**
  * Proxy for {@link JFormHelper::addFieldPath()}.
  *
  * @param   mixed  $new  A path or array of paths to add.
  *
  * @return  array  The list of paths that have been added.
  *
  * @since   11.1
  */
 public static function addFieldPath($new = null)
 {
     return JFormHelper::addFieldPath($new);
 }
Exemplo n.º 13
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/imc.php';
     $state = $this->get('State');
     $canDo = ImcHelper::getActions($state->get('filter.category_id'));
     JToolBarHelper::title(JText::_('COM_IMC_TITLE_ISSUES'), 'drawer');
     //Check if the form exists before showing the add/edit buttons
     $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/issue';
     if (file_exists($formPath)) {
         if ($canDo->get('core.create')) {
             JToolBarHelper::addNew('issue.add', 'JTOOLBAR_NEW');
         }
         if ($canDo->get('core.edit') && isset($this->items[0])) {
             JToolBarHelper::editList('issue.edit', 'JTOOLBAR_EDIT');
         }
     }
     if ($canDo->get('core.edit.state')) {
         if (isset($this->items[0]->state)) {
             JToolBarHelper::divider();
             JToolBarHelper::custom('issues.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
             JToolBarHelper::custom('issues.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         } else {
             if (isset($this->items[0])) {
                 //If this component does not use state then show a direct delete button as we can not trash
                 JToolBarHelper::deleteList('', 'issues.delete', 'JTOOLBAR_DELETE');
             }
         }
         if (isset($this->items[0]->state)) {
             JToolBarHelper::divider();
             JToolBarHelper::archiveList('issues.archive', 'JTOOLBAR_ARCHIVE');
         }
         if (isset($this->items[0]->checked_out)) {
             JToolBarHelper::custom('issues.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
         }
     }
     //Show trash and delete for components that uses the state field
     if (isset($this->items[0]->state)) {
         if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
             JToolBarHelper::deleteList('', 'issues.delete', 'JTOOLBAR_EMPTY_TRASH');
             JToolBarHelper::divider();
         } else {
             if ($canDo->get('core.edit.state')) {
                 JToolBarHelper::trash('issues.trash', 'JTOOLBAR_TRASH');
                 JToolBarHelper::divider();
             }
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_imc');
     }
     //Set sidebar action - New in 3.0
     JHtmlSidebar::setAction('index.php?option=com_imc&view=issues');
     $this->extra_sidebar = '';
     JHtmlSidebar::addFilter(JText::_("JOPTION_SELECT_CATEGORY"), 'filter_catid', JHtml::_('select.options', JHtml::_('category.options', 'com_imc'), "value", "text", $this->state->get('filter.catid')));
     //Get custom field
     JFormHelper::addFieldPath(JPATH_ROOT . '/components/com_imc/models/fields');
     $steps = JFormHelper::loadFieldType('Step', false);
     $options = $steps->getOptions();
     JHtmlSidebar::addFilter(JText::_("COM_IMC_ISSUES_STEPID_FILTER"), 'filter_stepid', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.stepid'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), "value", "text", $this->state->get('filter.state'), true));
 }
Exemplo n.º 14
0
<?php

/**
 * Dummy Library file.
 * Including this file into your application will make dummy available to use.
 *
 * @package    Dummy.Library
 * @copyright  Copyright (C) 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('JPATH_PLATFORM') or die;
// Define dummy Library Folder Path
define('JPATH_DUMMY_LIBRARY', __DIR__);
// Bootstraps redCORE
RBootstrap::bootstrap();
// Register library prefix
RLoader::registerPrefix('Dummy', JPATH_DUMMY_LIBRARY);
// Make available the dummy fields
JFormHelper::addFieldPath(JPATH_DUMMY_LIBRARY . '/form/fields');
// Make available the dummy form rules
JFormHelper::addRulePath(JPATH_DUMMY_LIBRARY . '/form/rules');
Exemplo n.º 15
0
</div>
                </div>
                
                 <div class="control-group">
                    <div class="control-label"><?php 
echo $this->form->getLabel('location');
?>
</div>
                    <div class="controls">
                    <?php 
$this->form->setFieldAttribute('location', 'latitude', $this->item->latitude ? $this->item->latitude : 21.0277644, $group = null);
$this->form->setFieldAttribute('location', 'longitude', $this->item->longitude ? $this->item->longitude : 105.83415979999995, $group = null);
echo $this->form->getInput('location');
?>
                   <?php 
JFormHelper::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR . '/elements');
$locationfield = JFormHelper::loadFieldType('location', false);
$location = $locationfield->getMap();
echo $location;
?>
                   </div>
                </div>
                
                 <div class="control-group">
                    <div class="control-label"><?php 
echo $this->form->getLabel('desc');
?>
</div>
                    <div class="controls"><?php 
echo $this->form->getInput('desc');
?>
Exemplo n.º 16
0
 public function loadDefaultObject($plugin, $name)
 {
     $this->id = 0;
     $this->plugin = $plugin;
     $this->system_name = $name;
     $this->display_name = $name;
     $this->type = "";
     $this->fb_built_in = 0;
     $this->extension_key = "";
     $this->published = 0;
     $this->params = new JRegistry();
     $this->created = "--";
     $this->modified = "--";
     $xml = JPATH_SITE . '/plugins/opengraph/' . $plugin . '/objects/' . $name . '.xml';
     if (JFile::exists($xml)) {
         JFormHelper::addFieldPath(JPATH_SITE . '/plugins/opengraph/' . $plugin . '/objects');
         $form = JForm::getInstance('opengraph.' . $plugin . '.' . $name, $xml);
         foreach ($form->getFieldset() as $field) {
             if ($field->value) {
                 $this->params->set($field->fieldname, $field->value);
             }
         }
     }
 }
Exemplo n.º 17
0
    function Offlajnjimport($key, $base = null)
    {
        return jimport($key);
    }
}
jimport('joomla.form.helper');
jimport('joomla.form.formfield');
jimport('joomla.filesystem.folder');
Offlajnjimport('joomla.utilities.simplexml');
@ini_set('memory_limit', '260M');
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die;
define("OFFLAJNADMINPARAMPATH", dirname(__FILE__) . DS . '..');
$_SESSION['OFFLAJNADMINPARAMPATH'] = OFFLAJNADMINPARAMPATH;
if (version_compare(JVERSION, '1.6.0', 'ge')) {
    JFormHelper::addFieldPath(JFolder::folders(OFFLAJNADMINPARAMPATH, '.', false, true));
}
//else if(isset($this)) $this->addElementPath(JFolder::folders(OFFLAJNADMINPARAMPATH, '.', false, true));
include_once dirname(__FILE__) . DS . 'library' . DS . 'fakeElementBase.php';
include_once dirname(__FILE__) . DS . 'library' . DS . 'parameter.php';
include_once dirname(__FILE__) . DS . 'library' . DS . 'flatArray.php';
include_once dirname(__FILE__) . DS . 'library' . DS . 'JsStack.php';
class JElementOfflajnDashboard extends JOfflajnFakeElementBase
{
    var $_name = 'OfflajnDashboard';
    var $attr;
    function loadDashboard()
    {
        $logoUrl = JURI::base(true) . '/../modules/' . $this->_moduleName . '/params/offlajndashboard/images/dashboard-offlajn.png';
        $supportTicketUrl = JURI::base(true) . '/../modules/' . $this->_moduleName . '/params/offlajndashboard/images/support-ticket-button.png';
        $supportUsUrl = JURI::base(true) . '/../modules/' . $this->_moduleName . '/params/offlajndashboard/images/support-us-button.png';
Exemplo n.º 18
0
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     JFormHelper::addFieldPath(dirname(__FILE__) . '/fields');
 }
Exemplo n.º 19
0
 */
defined('_JEXEC') or die;
JHtml::_('behavior.multiselect');
JHtml::_('formbehavior.chosen', 'select');
$this->sortColumn = $this->escape($this->state->get('list.ordering'));
$this->sortDirection = $this->escape($this->state->get('list.direction'));
//Get tshirt-size options
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$membersOptions = JFormHelper::loadFieldType('Members', false);
$tshirtOptions = $membersOptions->getOptionsTshirtSize();
// works only if you set your field getOptions on public!!
//Get camping options
$campingOptions = $membersOptions->getOptionsCamping();
// works only if you set your field getOptions on public!!
//Get services options
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$services = JFormHelper::loadFieldType('Services', false);
$servicesOptions = $services->getOptions();
// works only if you set your field getOptions on public!!
?>
<script language="javascript" type="text/javascript">
function tableOrdering( order, dir, task )
{
	var form = document.adminForm;
 
	form.filter_order.value = order;
	form.filter_order_Dir.value = dir;
	document.adminForm.submit( task );
}
</script>
<div id="j-sidebar-container" class="span2">
Exemplo n.º 20
0
 /**
  * JTheFactoryApplication::Initialize()
  *  loads some "magic" files like defines.php,loads the main helper file (APP_PREFIX.php)
  *  loads other helpers (through helper::loadHelperclasses)
  *  loads the needed Controller
  *  adds htmlelements and formelements to path (admin)
  *  adds tables to paths
  * 
  * @return void
  */
 function Initialize($task = null)
 {
     jimport('joomla.application.component.controller');
     if (!$this->frontpage) {
         JFormHelper::addFieldPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'formelements');
     }
     JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'htmlelements');
     JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables');
     if (file_exists(JPATH_COMPONENT_SITE . DS . 'defines.php')) {
         require_once JPATH_COMPONENT_SITE . DS . 'defines.php';
     }
     if (file_exists(JPATH_COMPONENT_SITE . DS . 'helpers' . DS . strtolower($this->appname) . '.php')) {
         require_once JPATH_COMPONENT_SITE . DS . 'helpers' . DS . strtolower($this->appname) . '.php';
     }
     $class_name = ucfirst($this->appname) . 'Helper';
     call_user_func(array($class_name, 'loadHelperClasses'));
     JTheFactoryEventsHelper::triggerEvent('onBeforeExecuteTask', array(&$this->_stopexecution));
     if ($this->_stopexecution) {
         return;
     }
     if (!$task) {
         $task = JRequest::getCmd('task');
     }
     $this->_controller = JTheFactoryHelper::loadController($task);
     //Try to load Framework controllers
     if (!$this->_controller) {
         $controllerClass = JRequest::getWord('controller');
         if (!$controllerClass && strpos($task, '.') !== FALSE) {
             $task = explode('.', $task);
             $controllerClass = $task[0];
         }
         if ($controllerClass) {
             $path = JPATH_COMPONENT . DS . 'controllers' . DS . basename($controllerClass) . '.php';
             file_exists($path) ? require_once $path : JError::raiseError(500, JText::_('ERROR_CONTROLLER_NOT_FOUND'));
             $controllerClass = 'J' . ucfirst($this->appname) . ($this->frontpage ? "" : "Admin") . 'Controller' . $controllerClass;
             $this->_controller = new $controllerClass();
         } else {
             $this->_controller = JControllerLegacy::getInstance('J' . ucfirst($this->appname) . ($this->frontpage ? "" : "Admin"));
         }
     }
 }
Exemplo n.º 21
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JToolBarHelper::title(JText::_('COM_COSTBENEFITPROJECTION_INTERVENTIONS'), 'wand');
     JHtmlSidebar::setAction('index.php?option=com_costbenefitprojection&view=interventions');
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     if ($this->canCreate) {
         JToolBarHelper::addNew('intervention.add');
     }
     // Only load if there are items
     if (CostbenefitprojectionHelper::checkArray($this->items)) {
         if ($this->canEdit) {
             JToolBarHelper::editList('intervention.edit');
         }
         if ($this->canState) {
             JToolBarHelper::publishList('interventions.publish');
             JToolBarHelper::unpublishList('interventions.unpublish');
             JToolBarHelper::archiveList('interventions.archive');
             if ($this->canDo->get('core.admin')) {
                 JToolBarHelper::checkin('interventions.checkin');
             }
         }
         // Add a batch button
         if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) {
             // Get the toolbar object instance
             $bar = JToolBar::getInstance('toolbar');
             // set the batch button name
             $title = JText::_('JTOOLBAR_BATCH');
             // Instantiate a new JLayoutFile instance and render the batch button
             $layout = new JLayoutFile('joomla.toolbar.batch');
             // add the button to the page
             $dhtml = $layout->render(array('title' => $title));
             $bar->appendButton('Custom', $dhtml, 'batch');
         }
         if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) {
             JToolbarHelper::deleteList('', 'interventions.delete', 'JTOOLBAR_EMPTY_TRASH');
         } elseif ($this->canState && $this->canDelete) {
             JToolbarHelper::trash('interventions.trash');
         }
         if ($this->canDo->get('core.export') && $this->canDo->get('intervention.export')) {
             JToolBarHelper::custom('interventions.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true);
         }
     }
     if ($this->canDo->get('core.import') && $this->canDo->get('intervention.import')) {
         JToolBarHelper::custom('interventions.importData', 'upload', '', 'COM_COSTBENEFITPROJECTION_IMPORT_DATA', false);
     }
     // set help url for this view if found
     $help_url = CostbenefitprojectionHelper::getHelpUrl('interventions');
     if (CostbenefitprojectionHelper::checkString($help_url)) {
         JToolbarHelper::help('COM_COSTBENEFITPROJECTION_HELP_MANAGER', false, $help_url);
     }
     // add the options comp button
     if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) {
         JToolBarHelper::preferences('com_costbenefitprojection');
     }
     if ($this->canState) {
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
         // only load if batch allowed
         if ($this->canBatch) {
             JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true));
         }
     }
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     if ($this->canBatch && $this->canCreate && $this->canEdit) {
         JHtmlBatch_::addListSelection(JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text'));
     }
     // Set Company Name Selection
     $this->companyNameOptions = JFormHelper::loadFieldType('Company')->getOptions();
     if ($this->companyNameOptions) {
         // Company Name Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL') . ' -', 'filter_company', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text', $this->state->get('filter.company')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Company Name Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL') . ' -', 'batch[company]', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text'));
         }
     }
     // Set Type Selection
     $this->typeOptions = $this->getTheTypeSelections();
     if ($this->typeOptions) {
         // Type Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL') . ' -', 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Type Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL') . ' -', 'batch[type]', JHtml::_('select.options', $this->typeOptions, 'value', 'text'));
         }
     }
     // Set Coverage Selection
     $this->coverageOptions = $this->getTheCoverageSelections();
     if ($this->coverageOptions) {
         // Coverage Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL') . ' -', 'filter_coverage', JHtml::_('select.options', $this->coverageOptions, 'value', 'text', $this->state->get('filter.coverage')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Coverage Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL') . ' -', 'batch[coverage]', JHtml::_('select.options', $this->coverageOptions, 'value', 'text'));
         }
     }
     // Set Duration Selection
     $this->durationOptions = $this->getTheDurationSelections();
     if ($this->durationOptions) {
         // Duration Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL') . ' -', 'filter_duration', JHtml::_('select.options', $this->durationOptions, 'value', 'text', $this->state->get('filter.duration')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Duration Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL') . ' -', 'batch[duration]', JHtml::_('select.options', $this->durationOptions, 'value', 'text'));
         }
     }
 }
Exemplo n.º 22
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support');
     JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=help_documents');
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     if ($this->canCreate) {
         JToolBarHelper::addNew('help_document.add');
     }
     // Only load if there are items
     if (ComponentbuilderHelper::checkArray($this->items)) {
         if ($this->canEdit) {
             JToolBarHelper::editList('help_document.edit');
         }
         if ($this->canState) {
             JToolBarHelper::publishList('help_documents.publish');
             JToolBarHelper::unpublishList('help_documents.unpublish');
             JToolBarHelper::archiveList('help_documents.archive');
             if ($this->canDo->get('core.admin')) {
                 JToolBarHelper::checkin('help_documents.checkin');
             }
         }
         // Add a batch button
         if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) {
             // Get the toolbar object instance
             $bar = JToolBar::getInstance('toolbar');
             // set the batch button name
             $title = JText::_('JTOOLBAR_BATCH');
             // Instantiate a new JLayoutFile instance and render the batch button
             $layout = new JLayoutFile('joomla.toolbar.batch');
             // add the button to the page
             $dhtml = $layout->render(array('title' => $title));
             $bar->appendButton('Custom', $dhtml, 'batch');
         }
         if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) {
             JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH');
         } elseif ($this->canState && $this->canDelete) {
             JToolbarHelper::trash('help_documents.trash');
         }
         if ($this->canDo->get('core.export') && $this->canDo->get('help_document.export')) {
             JToolBarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
         }
     }
     if ($this->canDo->get('core.import') && $this->canDo->get('help_document.import')) {
         JToolBarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false);
     }
     // set help url for this view if found
     $help_url = ComponentbuilderHelper::getHelpUrl('help_documents');
     if (ComponentbuilderHelper::checkString($help_url)) {
         JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
     }
     // add the options comp button
     if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) {
         JToolBarHelper::preferences('com_componentbuilder');
     }
     if ($this->canState) {
         JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true));
         // only load if batch allowed
         if ($this->canBatch) {
             JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true));
         }
     }
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')));
     if ($this->canBatch && $this->canCreate && $this->canEdit) {
         JHtmlBatch_::addListSelection(JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text'));
     }
     // Set Type Selection
     $this->typeOptions = $this->getTheTypeSelections();
     if ($this->typeOptions) {
         // Type Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL') . ' -', 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Type Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL') . ' -', 'batch[type]', JHtml::_('select.options', $this->typeOptions, 'value', 'text'));
         }
     }
     // Set Location Selection
     $this->locationOptions = $this->getTheLocationSelections();
     if ($this->locationOptions) {
         // Location Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL') . ' -', 'filter_location', JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('filter.location')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Location Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL') . ' -', 'batch[location]', JHtml::_('select.options', $this->locationOptions, 'value', 'text'));
         }
     }
     // Set Admin View Selection
     $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->getOptions();
     if ($this->admin_viewOptions) {
         // Admin View Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -', 'filter_admin_view', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('filter.admin_view')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Admin View Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -', 'batch[admin_view]', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text'));
         }
     }
     // Set Site View Selection
     $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->getOptions();
     if ($this->site_viewOptions) {
         // Site View Filter
         JHtmlSidebar::addFilter('- Select ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -', 'filter_site_view', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view')));
         if ($this->canBatch && $this->canCreate && $this->canEdit) {
             // Site View Batch Selection
             JHtmlBatch_::addListSelection('- Keep Original ' . JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -', 'batch[site_view]', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text'));
         }
     }
 }
Exemplo n.º 23
0
/**
 * Bootstrap file.
 * Including this file into your application will make redRad available to use.
 *
 * @package    RedRad
 * @copyright  Copyright (C) 2013 redCOMPONENT.com. All rights reserved.
 * @license    GNU General Public License version 2 or later, see LICENSE.
 */
defined('JPATH_PLATFORM') or die;
define('JPATH_REDRAD', __DIR__);
require JPATH_REDRAD . '/inflector/inflector.php';
// Use our own base field
if (!class_exists('JFormField', false)) {
    $baseField = JPATH_LIBRARIES . '/redrad/joomla/form/field.php';
    if (file_exists($baseField)) {
        require_once $baseField;
    }
}
// Register the classes for autoload.
JLoader::registerPrefix('R', JPATH_REDRAD);
// Setup the RLoader.
RLoader::setup();
// Make available the redRAD fields
JFormHelper::addFieldPath(JPATH_REDRAD . '/form/fields');
// Make available the redRAD form rules
JFormHelper::addRulePath(JPATH_REDRAD . '/form/rules');
// HTML helpers
JHtml::addIncludePath(JPATH_REDRAD . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_redrad', JPATH_SITE);
Exemplo n.º 24
0
<?php

defined('JPATH_PLATFORM') or die;
define('JPATH_OPENHRM', dirname(__FILE__));
require JPATH_OPENHRM . '/functions.php';
if (!class_exists('JFormField', false)) {
    $baseField = JPATH_LIBRARIES . '/openhrm/joomla/form/field.php';
    if (file_exists($baseField)) {
        require_once $baseField;
    }
}
// Register the classes for autoload.
JLoader::registerPrefix('R', JPATH_OPENHRM);
// Setup the RLoader.
RLoader::setup();
// Make available the openhrm fields
JFormHelper::addFieldPath(JPATH_OPENHRM . '/form/fields');
// Make available the openhrm form rules
JFormHelper::addRulePath(JPATH_OPENHRM . '/form/rules');
// HTML helpers
JHtml::addIncludePath(JPATH_OPENHRM . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_openhrm', JPATH_SITE);
Exemplo n.º 25
0
 function display($tpl = null)
 {
     $title = "JFBConnect: Open Graph";
     $app = JFactory::getApplication();
     $layout = $this->getLayout();
     if ($layout != 'display' && $layout != 'default') {
         JToolBarHelper::custom('display', 'opengraph.png', 'index.php?option=com_jfbconnect&view=opengraph', 'Open Graph Home', false);
         JToolBarHelper::divider();
     }
     switch ($this->getLayout()) {
         case 'actions':
             $title .= " - Actions";
             $bar = JToolBar::getInstance('toolbar');
             $bar->appendButton('Popup', 'new', 'New', 'index.php?option=com_jfbconnect&view=opengraph&task=actioncreate&tmpl=component', '550', '400', '0', '0', '');
             JToolBarHelper::publishList();
             JToolBarHelper::unpublishList();
             JToolBarHelper::deleteList('Deleting these actions will delete all activity associated with them. Are you sure?');
             $model = $this->getModel('OpenGraphAction', 'JFBConnectAdminModel');
             $actionsCustom = $model->getActions();
             $this->assignRef('actions', $actionsCustom);
             break;
         case 'actionedit':
             $title .= " - Edit Action";
             JToolBarHelper::apply('apply', 'Save');
             JToolBarHelper::save('save', 'Save & Close');
             JToolBarHelper::cancel('cancel', 'Cancel');
             $model = $this->getModel('OpenGraphAction', 'JFBConnectAdminModel');
             $id = JRequest::getInt('id', null);
             if ($id != 0) {
                 $action = $model->getAction($id);
             } else {
                 $plugin = JRequest::getCmd('plugin');
                 $name = JRequest::getCmd('name');
                 $action = new ogAction();
                 $action->loadDefaultAction($plugin, $name);
             }
             $this->assignRef('action', $action);
             $objectModel = $this->getModel('OpenGraphObject', 'JFBConnectAdminModel');
             $objects = $objectModel->getObjects(true);
             $this->assignRef('objects', $objects);
             break;
         case 'objects':
             $title .= " - Objects";
             $bar = JToolBar::getInstance('toolbar');
             $bar->appendButton('Popup', 'new', 'New', 'index.php?option=com_jfbconnect&view=opengraph&task=objectcreate&tmpl=component', '550', '400', '0', '0', '');
             JToolBarHelper::publishList();
             JToolBarHelper::unpublishList();
             JToolBarHelper::deleteList('Deleting these objects will delete all activity associated with them. Are you sure?');
             $objectModel = $this->getModel('OpenGraphObject', 'JFBConnectAdminModel');
             $objects = $objectModel->getObjects();
             $this->assignRef('objects', $objects);
             break;
             // Modal popups for selecting the action/object to create
         // Modal popups for selecting the action/object to create
         case 'actioncreate':
         case 'objectcreate':
             JPluginHelper::importPlugin('opengraph');
             $plugins = $app->triggerEvent('onOpenGraphGetPlugins');
             $this->assignRef('plugins', $plugins);
             break;
         case 'objectedit':
             $title .= " - Edit Object";
             JToolBarHelper::apply('apply', 'Save');
             JToolBarHelper::save('save', 'Save & Close');
             JToolBarHelper::cancel('cancel', 'Cancel');
             $model = $this->getModel('OpenGraphObject', 'JFBConnectAdminModel');
             $id = JRequest::getInt('id', 0);
             if ($id != 0) {
                 $object = $model->getObject($id);
             } else {
                 $plugin = JRequest::getString('plugin');
                 $name = JRequest::getString('name');
                 $object = new ogObject();
                 $object->loadDefaultObject($plugin, $name);
             }
             $this->assignRef('object', $object);
             // Load the params for this specific object
             jimport('joomla.filesystem.file');
             JFormHelper::addFieldPath(JPATH_SITE . '/plugins/opengraph/' . $object->plugin . '/objects');
             $xml = JPATH_SITE . '/plugins/opengraph/' . $object->plugin . '/objects/' . $object->system_name . '.xml';
             if (JFile::exists($xml)) {
                 $form = JForm::getInstance('opengraph.' . $object->plugin . '.' . $object->system_name, $xml);
                 $form->bind(array('params' => $object->params->toArray()));
             } else {
                 $form = null;
             }
             $this->assignRef('params', $form);
             break;
         case 'activitylist':
             $title .= " - Activity Log";
             $model = $this->getModel('OpenGraphActivity', 'JFBConnectAdminModel');
             $option = JRequest::getCmd('option');
             $view = JRequest::getCmd('view');
             $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'), 'int');
             $limitstart = $app->getUserStateFromRequest($option . $view . '.limitstart', 'limitstart', 0, 'int');
             $search = $app->getUserStateFromRequest($option . $view . 'search', 'search', '', 'string');
             $search = JString::strtolower($search);
             $filter_state = $app->getUserStateFromRequest($option . $view . 'filter_state', 'filter_state', -1, 'int');
             $filter_object = $app->getUserStateFromRequest($option . $view . 'filter_object', 'filter_object', -1, 'int');
             $filter_action = $app->getUserStateFromRequest($option . $view . 'filter_action', 'filter_action', -1, 'int');
             $filter_order = $app->getUserStateFromRequest($option . $view . 'filter_order', 'filter_order', 'id', 'cmd');
             $filter_order_Dir = $app->getUserStateFromRequest($option . $view . 'filter_order_Dir', 'filter_order_Dir', 'DESC', 'word');
             $lists = array();
             if (!$filter_order) {
                 $filter_order = 'id';
             }
             $lists['order_Dir'] = $filter_order_Dir;
             $lists['order'] = $filter_order;
             $lists['search'] = $search;
             $filter_state_options[] = JHTML::_('select.option', -1, JText::_('COM_JFBCONNECT_OPENGRAPH_SELECT_PUBLISHING_STATE'));
             $filter_state_options[] = JHTML::_('select.option', OG_ACTIVITY_PUBLISHED, JText::_('JPUBLISHED'));
             $filter_state_options[] = JHTML::_('select.option', OG_ACTIVITY_DELETED, JText::_('COM_JFBCONNECT_OPENGRAPH_DELETED'));
             $filter_state_options[] = JHTML::_('select.option', OG_ACTIVITY_ERROR, JText::_('COM_JFBCONNECT_OPENGRAPH_ERROR'));
             $lists['state'] = JHTML::_('select.genericlist', $filter_state_options, 'filter_state', 'onchange="this.form.submit()"', 'value', 'text', $filter_state);
             $objectOptions = $model->getObjectList();
             $filter_object_options[] = JHTML::_('select.option', -1, JText::_('COM_JFBCONNECT_OPENGRAPH_SELECT_OBJECT_TYPE'));
             foreach ($objectOptions as $newOption) {
                 $filter_object_options[] = JHTML::_('select.option', $newOption->id, $newOption->display_name);
             }
             $lists['object'] = JHTML::_('select.genericlist', $filter_object_options, 'filter_object', 'onchange="this.form.submit()"', 'value', 'text', $filter_object);
             $actionOptions = $model->getActionList();
             $filter_action_options[] = JHTML::_('select.option', -1, JText::_('COM_JFBCONNECT_OPENGRAPH_SELECT_ACTION_TYPE'));
             foreach ($actionOptions as $newOption) {
                 $filter_action_options[] = JHTML::_('select.option', $newOption->id, $newOption->display_name);
             }
             $lists['action'] = JHTML::_('select.genericlist', $filter_action_options, 'filter_action', 'onchange="this.form.submit()"', 'value', 'text', $filter_action);
             $this->assignRef('lists', $lists);
             JToolBarHelper::deleteList();
             $rows = $model->getRows();
             $this->assignRef('rows', $rows);
             $total = $model->getTotal();
             jimport('joomla.html.pagination');
             $pageNav = new JPagination($total, $limitstart, $limit);
             $this->assignRef('page', $pageNav);
             $objectModel = $this->getModel('OpenGraphObject', 'JFBConnectAdminModel');
             $this->assignRef('objectModel', $objectModel);
             $actionModel = $this->getModel('OpenGraphAction', 'JFBConnectAdminModel');
             $this->assignRef('actionModel', $actionModel);
             break;
         case 'settings':
             $title .= " - Settings";
             JToolBarHelper::apply('apply', 'Save');
             JToolBarHelper::save('save', 'Save & Close');
             JToolBarHelper::cancel('cancel', 'Cancel');
             $model = $this->getModel('config');
             $this->assignRef('model', $model);
             break;
         default:
             require_once JPATH_COMPONENT_ADMINISTRATOR . '/assets/sourcecoast.php';
             $versionChecker = new sourceCoastConnect('jfbconnect_j16', 'components/com_jfbconnect/assets/images/');
             $this->assignRef('versionChecker', $versionChecker);
             break;
     }
     JToolBarHelper::title($title, 'jfbconnect.png');
     SCAdminHelper::addAutotuneToolbarItem();
     parent::display($tpl);
 }
Exemplo n.º 26
0
$lang->load('com_citybranding', JPATH_ADMINISTRATOR);
$user = JFactory::getUser();
$canEdit = $user->authorise('core.edit', 'com_citybranding.poi.' . $this->item->id);
$canChange = $user->authorise('core.edit.state', 'com_citybranding.poi.' . $this->item->id);
$canEditOwn = $user->authorise('core.edit.own', 'com_citybranding.poi.' . $this->item->id);
if (!$canEdit && $user->authorise('core.edit.own', 'com_citybranding.poi.' . $this->item->id)) {
    $canEdit = $user->id == $this->item->created_by;
}
//Edit Own only if poi status is the initial one
$firstStep = CitybrandingFrontendHelper::getStepByStepId($this->item->stepid);
$canEditOnStatus = true;
if ($firstStep['ordering'] != 1) {
    $canEditOnStatus = false;
}
//poi statuses
JFormHelper::addFieldPath(JPATH_ROOT . '/components/com_citybranding/models/fields');
$step = JFormHelper::loadFieldType('Step', false);
$statuses = $step->getOptions();
?>

<script type="text/javascript">
    js = jQuery.noConflict();
    js(document).ready(function() {
		js('#gallery').photobox('a', { thumbs:true, loop:false }, callback);
		// using setTimeout to make sure all images were in the DOM, before the history.load() function is looking them up to match the url hash
		setTimeout(window._photobox.history.load, 2000);
		function callback(){
			//console.log('callback for loaded content:', this);
		};

		js( "#timeline" ).click(function() {
Exemplo n.º 27
0
<?php

/**
 * @package     Sample
 * @subpackage  Library
 *
 * @copyright   Copyright (C) 2013 Roberto Segura. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */
defined('_JEXEC') or die;
// Ensure that autoloaders are set
JLoader::setup();
// Global libraries autoloader
JLoader::registerPrefix('Hepta', dirname(__FILE__));
// Common fields
JFormHelper::addFieldPath(dirname(__FILE__) . '/form/field');
// Common form rules
JFormHelper::addRulePath(dirname(__FILE__) . '/form/rule');
// Common HTML helpers
JHtml::addIncludePath(dirname(__FILE__) . '/html');
// Load library language
$lang = JFactory::getLanguage();
$lang->load('lib_hepta_formfields', JPATH_SITE);
Exemplo n.º 28
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/imc.php';
     $state = $this->get('State');
     $canDo = ImcHelper::getActions($state->get('filter.category_id'));
     $canManageLogs = $canDo->get('imc.manage.logs');
     JToolBarHelper::title(JText::_('COM_IMC_TITLE_LOGS'), 'stack');
     //Check if the form exists before showing the add/edit buttons
     $formPath = JPATH_COMPONENT_ADMINISTRATOR . '/views/log';
     if (file_exists($formPath)) {
         if ($canDo->get('core.create') && $canManageLogs) {
             //Log populated automatically thus no need to allow add new
             //JToolBarHelper::addNew('log.add', 'JTOOLBAR_NEW');
         }
         if ($canDo->get('core.edit') && isset($this->items[0]) && $canManageLogs) {
             JToolBarHelper::editList('log.edit', 'JTOOLBAR_EDIT');
         }
     }
     if ($canDo->get('core.edit.state') && $canManageLogs) {
         if (isset($this->items[0]->state)) {
             JToolBarHelper::divider();
             JToolBarHelper::custom('logs.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_PUBLISH', true);
             JToolBarHelper::custom('logs.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);
         } else {
             if (isset($this->items[0])) {
                 //If this component does not use state then show a direct delete button as we can not trash
                 JToolBarHelper::deleteList('', 'logs.delete', 'JTOOLBAR_DELETE');
             }
         }
         if (isset($this->items[0]->state)) {
             JToolBarHelper::divider();
             JToolBarHelper::archiveList('logs.archive', 'JTOOLBAR_ARCHIVE');
         }
         if (isset($this->items[0]->checked_out)) {
             JToolBarHelper::custom('logs.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true);
         }
     }
     //Show trash and delete for components that uses the state field
     if (isset($this->items[0]->state)) {
         if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
             JToolBarHelper::deleteList('', 'logs.delete', 'JTOOLBAR_EMPTY_TRASH');
             JToolBarHelper::divider();
         } else {
             if ($canDo->get('core.edit.state')) {
                 JToolBarHelper::trash('logs.trash', 'JTOOLBAR_TRASH');
                 JToolBarHelper::divider();
             }
         }
     }
     if ($canDo->get('core.admin')) {
         JToolBarHelper::preferences('com_imc');
     }
     //Set sidebar action - New in 3.0
     JHtmlSidebar::setAction('index.php?option=com_imc&view=logs');
     $this->extra_sidebar = '';
     //Filter for the field ".issueid;
     jimport('joomla.form.form');
     $options = array();
     JForm::addFormPath(JPATH_COMPONENT . '/models/forms');
     $form = JForm::getInstance('com_imc.log', 'log');
     $field = $form->getField('issueid');
     $query = $form->getFieldAttribute('filter_issueid', 'query');
     $translate = $form->getFieldAttribute('filter_issueid', 'translate');
     $key = $form->getFieldAttribute('filter_issueid', 'key_field');
     $value = $form->getFieldAttribute('filter_issueid', 'value_field');
     // Get the database object.
     $db = JFactory::getDBO();
     // Set the query and get the result list.
     $db->setQuery($query);
     $items = $db->loadObjectlist();
     // Build the field options.
     if (!empty($items)) {
         foreach ($items as $item) {
             if ($translate == true) {
                 $options[] = JHtml::_('select.option', $item->{$key}, JText::_($item->{$value}));
             } else {
                 $options[] = JHtml::_('select.option', $item->{$key}, $item->{$value});
             }
         }
     }
     JHtmlSidebar::addFilter(JText::_("COM_IMC_LOGS_ISSUEID_FILTER"), 'filter_issueid', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.issueid'), true));
     //Get custom field
     JFormHelper::addFieldPath(JPATH_ROOT . '/components/com_imc/models/fields');
     $steps = JFormHelper::loadFieldType('Step', false);
     $options = $steps->getOptions();
     JHtmlSidebar::addFilter(JText::_("COM_IMC_ISSUES_STEPID_FILTER"), 'filter_stepid', JHtml::_('select.options', $options, "value", "text", $this->state->get('filter.stepid'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_published', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), "value", "text", $this->state->get('filter.state'), true));
 }
Exemplo n.º 29
0
 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since   1.0.0
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     JFormHelper::addFieldPath(__DIR__ . '/fields');
 }
Exemplo n.º 30
0
 * @copyright   Tracks (C) 2008-2015 Julien Vonthron. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */
defined('_JEXEC') or die;
$redcoreLoader = JPATH_LIBRARIES . '/redcore/bootstrap.php';
if (!file_exists($redcoreLoader) || !JPluginHelper::isEnabled('system', 'redcore')) {
    throw new Exception(JText::_('COM_TRACKS_REDCORE_INIT_FAILED'), 404);
}
include_once $redcoreLoader;
// Bootstraps redCORE
RBootstrap::bootstrap();
// Register library prefix
RLoader::registerPrefix('Trackslib', __DIR__);
// Make available the fields
JFormHelper::addFieldPath(JPATH_LIBRARIES . '/tracks/form/field');
JFormHelper::addFieldPath(JPATH_LIBRARIES . '/tracks/form/fields');
// Make available the form rules
JFormHelper::addRulePath(JPATH_LIBRARIES . '/tracks/form/rule');
JFormHelper::addRulePath(JPATH_LIBRARIES . '/tracks/form/rules');
/**
 * Tracks bootstrap class
 *
 * @package     Tracks
 * @subpackage  Library
 * @since       3.0
 */
class TrackslibBootstrap
{
    /**
     * Effectively bootstraps Tracks
     *