Exemplo n.º 1
0
 /**
  * Creates a custom form element.
  *
  * @param mixed $parent
  */
 public function __construct($parent = null)
 {
     parent::__construct($parent);
     $this->_template = KService::get('com:base.template.default');
     $this->_template->addFilter(array('shorttag', 'alias'));
     $this->_template->getFilter('alias')->append(array('@route(' => 'JRoute::_(', '@html(\'' => '$this->renderHelper(\'com:base.template.helper.html.'));
 }
Exemplo n.º 2
0
 function fetchTooltip($label, $description, &$node, $control_name, $name)
 {
     $this->_nnfield = new nnFieldPlainText();
     if (!$node->attributes('label') != '') {
         return '';
     }
     return parent::fetchTooltip($label, $description, $node, $control_name, $name);
 }
Exemplo n.º 3
0
 function fetchTooltip($label, $description, &$node, $control_name, $name)
 {
     if (substr($name, 0, 1) == '@' || !isset($node->_attributes['label']) || !$node->_attributes['label']) {
         return;
     } else {
         return parent::fetchTooltip($label, $description, $node, $control_name, $name);
     }
 }
Exemplo n.º 4
0
 function fetchTooltip($label, $description, &$node, $control_name, $name)
 {
     $nostyle = $node->attributes('nostyle');
     if ($nostyle) {
         return JElement::fetchTooltip($label, '', $node, $control_name, $name);
     }
     return;
 }
Exemplo n.º 5
0
 /**
  * Constructor
  *
  * @access protected
  */
 function __construct($parent = null)
 {
     // Must load admin language files
     $lang = JFactory::getLanguage();
     $lang->load("com_jevents", JPATH_ADMINISTRATOR);
     parent::__construct($parent);
     $this->data = array();
     $this->labeldata = array();
 }
Exemplo n.º 6
0
 public function __construct($parent = null)
 {
     global $gantry;
     parent::__construct($parent);
     $gantry->addAdminElement(get_class($this));
 }
Exemplo n.º 7
0
 public function fetchElement($name, $value, &$node, $control_name)
 {
     $fileList = parent::fetchElement($name, $value, $node, $control_name);
     return JbetoloClearcacheElement::ui($name);
 }
Exemplo n.º 8
0
 function __construct()
 {
     parent::__construct();
 }
Exemplo n.º 9
0
 /**
  * Method to get the list of files for the field options.
  * Specify the target directory with a directory attribute
  * Attributes allow an exclude mask and stripping of extensions from file name.
  * Default attribute may optionally be set to null (no file) or -1 (use a default).
  *
  * @return  array  The field option objects.
  *
  * @since   1.5
  */
 function fetchElement($name, $value, &$node, $control_name)
 {
     // element params
     if (FLEXI_J16GE) {
         $node =& $this->element;
         $attributes = get_object_vars($node->attributes());
         $attributes = $attributes['@attributes'];
     } else {
         $attributes =& $node->_attributes;
     }
     // value
     $value = FLEXI_J16GE ? $this->value : $value;
     $value = $value ? $value : $attributes['default'];
     // Get current extension and id being edited
     $view = JRequest::getVar('view');
     $option = JRequest::getVar('option');
     if ($option == 'com_modules' || $option == 'com_advancedmodules') {
         $view = 'module';
     }
     $cid = JRequest::getVar('cid', array(0), $hash = 'default', 'array');
     JArrayHelper::toInteger($cid, array(0));
     $pk = $cid[0];
     if (!$pk) {
         $pk = JRequest::getInt('id', 0);
     }
     // Initialize variables.
     $options = array();
     // Initialize some field attributes.
     $filter = (string) @$attributes['filter'];
     $exclude = (string) @$attributes['exclude'];
     $stripExt = (string) @$attributes['stripext'];
     $hideNone = (string) @$attributes['hide_none'];
     $hideDefault = (string) @$attributes['hide_default'];
     // Get the path which contains layouts
     $directory = (string) @$attributes['directory'];
     $path = (!is_dir($directory) ? JPATH_ROOT : '') . $directory;
     // For using directory in url
     $directory = str_replace('\\', '/', $directory);
     // Prepend some default options based on field attributes.
     if (!$hideNone) {
         $options[] = JHTML::_('select.option', '-1', '- ' . JText::_('Do not use') . ' -');
     }
     if (!$hideDefault) {
         $options[] = JHTML::_('select.option', '', '- ' . JText::_('Use default') . ' -');
     }
     // Get a list of files in the search path with the given filter.
     $files = JFolder::files($path, $filter);
     // Build the options list from the list of files.
     if (is_array($files)) {
         foreach ($files as $file) {
             // Check to see if the file is in the exclude mask.
             if ($exclude && preg_match(chr(1) . $exclude . chr(1), $file)) {
                 continue;
             }
             // If the extension is to be stripped, do it.
             if ($stripExt) {
                 $file = JFile::stripExt($file);
             }
             $options[] = JHTML::_('select.option', $file, $file);
             $layouts[] = $file;
         }
     }
     // Merge any additional options in the XML definition.
     if (FLEXI_J16GE) {
         $options = array_merge(parent::getOptions(), $options);
     }
     // Element name and id
     $_name = FLEXI_J16GE ? $this->fieldname : $name;
     $fieldname = FLEXI_J16GE ? $this->name : $control_name . '[' . $name . ']';
     $element_id = FLEXI_J16GE ? $this->id : $control_name . $name;
     // Add tag attributes
     $attribs = !FLEXI_J16GE ? ' style="float:left;" ' : '';
     if (@$attributes['multiple'] == 'multiple' || @$attributes['multiple'] == 'true') {
         $attribs .= ' multiple="multiple" ';
         $attribs .= @$attributes['size'] ? ' size="' . @$attributes['size'] . '" ' : ' size="6" ';
         $fieldname .= !FLEXI_J16GE ? "[]" : "";
         // NOTE: this added automatically in J2.5
     } else {
         $attribs .= 'class="inputbox"';
     }
     // Container of parameters
     $tmpl_container = (string) @$attributes['tmpl_container'];
     // Add JS code to display parameters, either via 'file' or 'inline'
     // For modules we can not use method 'file' (external xml file), because J2.5+ does form validation on the XML file ...
     $params_source = (string) @$attributes['params_source'];
     $container_sx = FLEXI_J16GE ? '-options' : '-page';
     if (!@$attributes['skipparams']) {
         $doc = JFactory::getDocument();
         $js = "\n\n" . ($params_source == "file" ? "\n\nfunction fc_getLayout(el) {\n\tvar layouts = new Array('" . implode("','", $layouts) . "');\n\tfor (i=0; i<layouts.length; i++) {\n\t\tvar container = \$('" . $tmpl_container . "_'+ layouts[i] + '" . $container_sx . "');\n\t\tif (container) container.getParent().setStyle('display', 'none');\n  }\n\t\n\tvar layout_name = el.value;\n\tvar panel_header = \$('" . $tmpl_container . "' + '" . $container_sx . "');\n\tvar panel = panel_header.getNext();\n\tvar _loading_img = '<img src=\"components/com_flexicontent/assets/images/ajax-loader.gif\" align=\"center\">';\n\tpanel_header.setHTML('<span>Layout: '+_loading_img+' </span>');\n\tpanel.setHTML('');\n\tvar ajaxoptions ={\n\t\tmethod: 'get',\n\t\tupdate: panel,\n\t\tonComplete:function(response) {\n\t\t\tpanel_header.setHTML('<span>Layout: <small>'+layout_name+'</small></span>');\n\t\t\t/* nothing to do */\n\t\t}\n\t};\n\tvar ajaxobj = new Ajax(\n\t\t'index.php?option=com_flexicontent&controller=templates&task=getlayoutparams&ext_view=" . $view . "&ext_id=" . $pk . "&directory=" . $directory . "&layout_name='+layout_name+'&format=raw',\n\t\tajaxoptions);\n\tajaxobj.request.delay(300, ajaxobj);\n}\n\n" : "\n\nfunction fc_getLayout(el) {\n\tvar container = \$('" . $tmpl_container . $container_sx . "');\n\tif (container) container.getParent().setStyle('display', 'none');\n\t\n\tvar layouts = new Array('" . implode("','", $layouts) . "');\n\tfor (i=0; i<layouts.length; i++) {\n\t\tvar container = \$('" . $tmpl_container . "_' + layouts[i] + '" . $container_sx . "');\n\t\tif (container) container.getParent().setStyle('display', 'none');\n  }\n\t\n  var layout_name = el.value;\n  var container = \$('" . $tmpl_container . "_'+ layout_name + '" . $container_sx . "');\n  if (container) container.getParent().setStyle('display', '');\n}\n\n") . "\n\nwindow.addEvent('domready', function(){\n\tfc_getLayout(\$('params" . $_name . "'));\n});\n\nwindow.addEvent('domready', function() {\n\t\$\$('#params" . $_name . "').addEvent('change', function() {\n\t\tfc_getLayout(this);\n\t});\n});\n\n";
         $doc->addScriptDeclaration($js);
     }
     // Create form element
     return JHTML::_('select.genericlist', $options, $fieldname, $attribs, 'value', 'text', $value, $element_id);
 }
Exemplo n.º 10
0
 public function fetchTooltip($label, $description, &$node, $control_name, $name)
 {
     switch ($label) {
         case 'cid':
             if ($this->task) {
                 return '&nbsp;';
             }
             $label = JText::_('SP.SOBI_SELECT_CATEGORY');
             break;
         case 'SOBI_SELECT_DATE':
             if ($this->task != 'list.date') {
                 return null;
             }
             $label = JText::_('SP.SOBI_SELECT_ENTRY');
             break;
     }
     return parent::fetchTooltip($label, $node->attributes('msg'), $node, $control_name, $name);
 }