Beispiel #1
10
 protected function getInput()
 {
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     $params = JComponentHelper::getParams("com_jevents");
     $value = (int) $this->value;
     if ($value == -1) {
         if (version_compare(JVERSION, '3.0.0', "<")) {
             $default25 = (string) $this->element["default25"];
             if ($default25 != "") {
                 $this->value = $this->default = intval($default25);
             }
         } else {
             if (version_compare(JVERSION, '3.0.0', ">=")) {
                 $default30 = (string) $this->element["default30"];
                 if ($default30 != "") {
                     $this->value = $this->default = intval($default30);
                 }
             }
         }
     }
     if (!$params->get("bootstrapchosen", 1)) {
         $x = 1;
     }
     return parent::getInput();
 }
Beispiel #2
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $doc = JFactory::getDocument();
     // add documentation toolbar button
     if (version_compare(JVERSION, '3.0.0') == -1) {
         $button = '<a href="' . $this->documentation . '" style="font-weight:bold;border-color:#025A8D;background-color:#DBE4E9;" target="_blank"><span class="icon-32-help"> </span> ' . JText::_('MOD_PWEBFBLIKEBOX_DOCUMENTATION') . '</a>';
     } else {
         $button = '<a href="' . $this->documentation . '" class="btn btn-small btn-info" target="_blank"><i class="icon-support"> </i> ' . JText::_('MOD_PWEBFBLIKEBOX_DOCUMENTATION') . '</a>';
     }
     $bar = JToolBar::getInstance();
     $bar->appendButton('Custom', $button, $this->extension . '-docs');
     // add script
     $doc->addScript(JUri::root(true) . '/media/mod_pwebfblikebox/js/admin.js');
     JText::script('MOD_PWEBFBLIKEBOX_WIDTH_MESSAGE');
     // add feed script
     if ($this->value) {
         $db = JFactory::getDBO();
         $query = $db->getQuery(true);
         $query->select('manifest_cache');
         $query->from('#__extensions');
         $query->where('type = "module"');
         $query->where('element = "mod_pwebfblikebox"');
         $db->setQuery($query);
         try {
             $manifest_str = $db->loadResult();
         } catch (RuntimeException $e) {
             $manifest_str = null;
         }
         $manifest = new JRegistry($manifest_str);
         $doc->addScriptDeclaration('(function(){' . 'var pw=document.createElement("script");pw.type="text/javascript";pw.async=true;' . 'pw.src="https://www.perfect-web.co/index.php?option=com_pwebshop&view=updates&format=raw&extension=' . $this->extension . '&version=' . $manifest->get('version', '1.0.0') . '&jversion=' . JVERSION . '&host=' . urlencode(JUri::root()) . '";' . 'var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(pw,s);' . '})();');
     }
     return parent::getInput();
 }
 protected function getInput()
 {
     if (JPluginHelper::isEnabled('system', 'wow')) {
         return parent::getInput();
     }
     return '';
 }
Beispiel #4
0
    protected function getInput()
    {
        $html = parent::getInput();

        // Automatically hide/show the owners list filter depending on chosen value.
        $html .= '<script>
            kQuery(function($) {
                var users_listbox = $("#docman_users_select2").parents("div.control-group"),
                    hide = function() {
                        users_listbox.hide();
                    },
                    show = function() { users_listbox.show(); },
                    own  = $(\'input[name="' . $this->name . '"]:checked\').val();

                if (!users_listbox.length) {
                    users_listbox = $("#docman_users_select2").parents("li")
                }

                if (own == 1) {
                    hide();
                }

                $("#' . $this->id . '0").click(function() {
                    hide();
                });

                $("#' . $this->id . '1").click(function() {
                    show();
                });
            });
        </script>';

        return $html;
    }
Beispiel #5
0
 public function getInput()
 {
     if (!self::hide_it()) {
         return parent::getInput();
     }
     return '';
 }
Beispiel #6
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  */
 protected function getInput()
 {
     if ((int) $this->form->getValue('form') === 0) {
         return '<input class="readonly" size="60" value="' . JText::_('COM_FABRIK_FIELD_ASSIGN_GROUP_TO_FORM_FIRST') . '" type="readonly" />';
     } else {
         return parent::getInput();
     }
 }
Beispiel #7
0
 protected function getInput()
 {
     $classes = array('radio', 'btn-group', 'btn-group-yesno');
     if (in_array($this->fieldname, array('published', 'enabled', 'state'))) {
         $classes[] = 'jpublished';
     }
     $this->class = implode(' ', $classes);
     return parent::getInput();
 }
Beispiel #8
0
 protected function getInput()
 {
     $style = ' class="jev_none" ';
     // if not showing copyright show message
     if (!$this->value) {
         $style = ' class="jev_block" ';
     }
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return parent::getInput() . '<div id="jevcopymsg" ' . $style . '>' . JText::_("Before removing the copyright footer please read this important message at the <a href='https://www.jevents.net/hidecopyright?tmpl=component&template=beez_20' title='get hide copyright code' class='modal' rel='{handler: \"iframe\", size: {x: 650, y: 450}}'>JEvents website</a>.") . '</div>';
 }
 /**
  * Method to get the field input markup.
  *
  * @return  string	The field input markup.
  *
  * @since   1.6
  */
 protected function getInput()
 {
     if (!$this->value) {
         $conf = JFactory::getConfig();
         if ($conf->get('sampledata')) {
             $this->value = $conf->get('sampledata');
         } else {
             $this->value = '';
         }
     }
     return parent::getInput();
 }
Beispiel #10
0
 * 	type="JSRadio"


 * 	default="1"


 * 	label="MOD_JS_LABEL"


 * 	description="MOD_JS_DESC">


 * 	<option value="1" sub_fields="mod_yes_field_1,mod_yes_field_2">JYES</option>


 * 	<option value="0" sub_fields="mod_no_field_1,mod_no_field_2">JNO</option>


 * </field>
Beispiel #11
0
 protected function getInput()
 {
     global $JElementJSRadioJSWritten;
     if (!$JElementJSRadioJSWritten) {
         $file = dirname(__FILE__) . DS . "jsradio.js";
         $url = str_replace(JPATH_ROOT, JURI::root(true), $file);
         $url = str_replace(DS, "/", $url);
         $doc = JFactory::getDocument();
         $doc->addScript($url);
         $JElementJSRadioJSWritten = TRUE;
     }
     $this->element['class'] = $this->element['class'] ? 'jck_radio btn-group' . chr(32) . (string) $this->element['class'] : 'jck_radio btn-group';
     return parent::getInput();
 }
 /**
  * Method to get the field input markup.
  *
  * Options:
  *  - target: the group id to toggler
  *  - Show: the radio list's value to show target
  *  - Hide: the radio list's value to hide the target
  *  - alt: another group id, which is shown when target is hidden and hidden when target shown.
  *
  * @return	string	The field input markup.
  */
 protected function getInput()
 {
     $alt = $this->element['alt'];
     $script = array();
     $script[] = "window.addEvent('domready', function() {\n\t\tvar s = document.id('" . $this->id . "').getElements('input').filter(function (e) {\n\t\treturn (e.checked);\n\t\t});\n\t\tif (s[0].get('value') == '" . $this->element['hide'] . "') {\n\t\t\tdocument.id('" . $this->element['toggle'] . "').hide();\n\t\t}";
     if ($alt) {
         $script[] = "if (s[0].get('value') == '" . $this->element['show'] . "') {\n\t\t\tdocument.id('" . $alt . "').hide();\n\t\t}";
     }
     $script[] = "document.id('" . $this->id . "').getElements('input').addEvent('change', function (e) {\n\t\t\t\tif (e.target.checked == true) {\n\t\t\t\t\tvar v = e.target.get('value');\n\t\t\t\t\tif (v == '" . $this->element['show'] . "') {\n\t\t\t\t\t\tdocument.id('" . $this->element['toggle'] . "').show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (v == '" . $this->element['hide'] . "') {\n\t\t\t\t\t\t\tdocument.id('" . $this->element['toggle'] . "').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}";
     if ($alt) {
         $script[] = "if (v == '" . $this->element['show'] . "') {\n\t\t\t\t\t\tdocument.id('" . $alt . "').hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (v == '" . $this->element['hide'] . "') {\n\t\t\t\t\t\t\tdocument.id('" . $alt . "').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}";
     }
     $script[] = "\n\t\t\t\t}\n\t\t\t});\n\t\t})";
     FabrikHelperHTML::addScriptDeclaration(implode("\n", $script));
     return parent::getInput();
 }
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $doc = JFactory::getDocument();
     // add documentation toolbar button
     if (version_compare(JVERSION, '3.0.0') == -1) {
         $button = '<a href="' . $this->documentation . '" style="font-weight:bold;border-color:#025A8D;background-color:#DBE4E9;" target="_blank"><span class="icon-32-help"> </span> ' . JText::_('MOD_PWEBFBLIKEBOX_DOCUMENTATION') . '</a>';
     } else {
         $button = '<a href="' . $this->documentation . '" class="btn btn-small btn-info" target="_blank"><i class="icon-support"> </i> </span> ' . JText::_('MOD_PWEBFBLIKEBOX_DOCUMENTATION') . '</a>';
     }
     $bar = JToolBar::getInstance();
     $bar->appendButton('Custom', $button, $this->extension . '-docs');
     // add script
     $doc->addScript(JURI::root(true) . '/media/mod_pwebfblikebox/js/admin.js');
     // add feed script
     if ($this->value) {
         $doc->addScriptDeclaration('(function(){' . 'var pw=document.createElement("script");pw.type="text/javascript";pw.async=true;' . 'pw.src="//www.perfect-web.co/updates/feed.js?ext=' . $this->extension . '&j=' . JVERSION . '";' . 'var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(pw,s);' . '})();');
     }
     return parent::getInput();
 }
Beispiel #14
0
 /**
  * Method to get the field input markup.
  *
  * Options:
  *  - target: the group id to toggler
  *  - Show: the radio list's value to show target
  *  - Hide: the radio list's value to hide the target
  *  - alt: another group id, which is shown when target is hidden and hidden when target shown.
  *
  * @return	string	The field input markup.
  */
 protected function getInput()
 {
     $fs = str_replace("'", '"', $this->element['fieldsets']);
     $script = array();
     if ($fs !== '') {
         /**
         * New way:
         *
         * <field name="slack_attachment"
         			type="toggleoptionsradio"
         			class="btn-group"
         			default="0"
         			description="PLG_FORM_SLACK_ATTACHMENTS_DESC"
         			label="PLG_FORM_SLACK_ATTACHMENTS_LABEL"
         			fieldsets="{'0':'plg-form-slack-simple','1':'plg-form-slack-attachments'}">
         			<option value="0">JNO</option>
         			<option value="1">JYES</option>
         			</field>
         *
         */
         $script[] = "jQuery('document').ready(function(\$) {\n\t\t\t\tvar fs = {$fs};\n\t\t\t\tvar v = \$('#" . $this->id . "').find('input:checked').val();\n\t\t\t\t\$.each(fs, function (value, fieldset) {\n\t\t\t\t\tv !== value ? \$('#' + fieldset).hide() : \$('#' + fieldset).show();\n\t\t\t\t\tv !== value ? \$('a[href*=' + fieldset + ']').hide() : \$('a[href*=' + fieldset + ']').show();\n\t\t\t\t});\n\n\t\t\t\t \$('#" . $this->id . "').find('input').on('click', function () {\n\t\t\t\t    var v = \$(this).val();\n\t\t\t\t    \$.each(fs, function (value, fieldset) {\n\t\t\t\t\t\tv !== value ? \$('#' + fieldset).hide() : \$('#' + fieldset).show();\n\t\t\t\t\t\tv !== value ? \$('a[href*=' + fieldset + ']').hide() : \$('a[href*=' + fieldset + ']').show();\n\t\t\t\t\t});\n\t\t\t\t });\n\t\t\t});";
     } else {
         $alt = $this->element['alt'];
         $script[] = "window.addEvent('domready', function() {\n\t\tvar s = document.id('" . $this->id . "').getElements('input').filter(function (e) {\n\t\treturn (e.checked);\n\t\t});\n\t\tif (s[0].get('value') == '" . $this->element['hide'] . "') {\n\t\t\tdocument.id('" . $this->element['toggle'] . "').hide();\n\t\t}";
         if ($alt) {
             $script[] = "if (s[0].get('value') == '" . $this->element['show'] . "') {\n\t\t\tdocument.id('" . $alt . "').hide();\n\t\t}";
         }
         $script[] = "document.id('" . $this->id . "').getElements('input').addEvent('change', function (e) {\n\t\t\t\tif (e.target.checked == true) {\n\t\t\t\t\tvar v = e.target.get('value');\n\t\t\t\t\tif (v == '" . $this->element['show'] . "') {\n\t\t\t\t\t\tdocument.id('" . $this->element['toggle'] . "').show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (v == '" . $this->element['hide'] . "') {\n\t\t\t\t\t\t\tdocument.id('" . $this->element['toggle'] . "').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}";
         if ($alt) {
             $script[] = "if (v == '" . $this->element['show'] . "') {\n\t\t\t\t\t\tdocument.id('" . $alt . "').hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (v == '" . $this->element['hide'] . "') {\n\t\t\t\t\t\t\tdocument.id('" . $alt . "').show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}";
         }
         $script[] = "\n\t\t\t\t}\n\t\t\t});\n\t\t})";
     }
     FabrikHelperHTML::addScriptDeclaration(implode("\n", $script));
     return parent::getInput();
 }
Beispiel #15
0
 /**
  * Method to construct the HTML of this element
  *
  * @param null
  * @return string
  */
 protected function getInput()
 {
     $this->class = 'radio btn-group btn-group-yesno';
     return parent::getInput();
 }
Beispiel #16
0
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     $script = "head.ready(function() {\n\t\tvar s = \$('" . $this->id . "').getElements('input').filter(function(e){\n\t\treturn (e.checked);\n\t\t});\n\t\tif(s[0].get('value') == '" . $this->element['hide'] . "'){\n\t\t\t\$('" . $this->element['toggle'] . "').hide();\n\t\t}\n\t\t\t\$('" . $this->id . "').getElements('input').addEvent('change', function(e){\n\t\t\t\tif(e.target.checked == true){\n\t\t\t\t\tvar v = e.target.get('value');\n\t\t\t\t\tif(v == '" . $this->element['show'] . "') {\n\t\t\t\t\t\t\$('" . $this->element['toggle'] . "').show();\n\t\t\t\t\t} else{\n\t\t\t\t\t\tif(v == '" . $this->element['hide'] . "') {\n\t\t\t\t\t\t\t\$('" . $this->element['toggle'] . "').hide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t})";
     FabrikHelperHTML::addScriptDeclaration($script);
     return parent::getInput();
 }
 function getInput()
 {
     $this->value = $this->form->getValue('id') == 0 ? 1 : 0;
     return parent::getInput();
 }
Beispiel #18
0
 protected function getInput()
 {
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return parent::getInput();
 }