You've already forked joomla_test
first commit
This commit is contained in:
60
modules/mod_roknavmenu/fields/break.php
Normal file
60
modules/mod_roknavmenu/fields/break.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Platform
|
||||
* @subpackage Form
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE
|
||||
*/
|
||||
|
||||
defined('JPATH_PLATFORM') or die;
|
||||
|
||||
/**
|
||||
* Form Field class for the Joomla Platform.
|
||||
* Supports a one line text field.
|
||||
*
|
||||
* @package Joomla.Platform
|
||||
* @subpackage Form
|
||||
* @link http://www.w3.org/TR/html-markup/input.text.html#input.text
|
||||
* @since 11.1
|
||||
*/
|
||||
class JFormFieldBreak extends JFormField
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type = 'Break';
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getLabel()
|
||||
{
|
||||
$doc = JFactory::getDocument();
|
||||
$version = new JVersion();
|
||||
$doc->addStyleDeclaration(".rok-break {border-bottom:1px solid #eee;font-size:16px;color:#0088CC;margin-top:15px;padding:2px 0;width:100%}");
|
||||
|
||||
if (isset($this->element['label']) && !empty($this->element['label'])) {
|
||||
$label = JText::_((string)$this->element['label']);
|
||||
$css = (string)$this->element['class'];
|
||||
$version = new JVersion();
|
||||
if (version_compare($version->getShortVersion(), '3.0', '>=')) {
|
||||
return '<div class="rok-break ' . $css . '">' . $label . '</div>';
|
||||
} else {
|
||||
return '<label class="rok-break ' . $css . '">' . $label . '</label>';
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
14
modules/mod_roknavmenu/fields/childtype.js
Normal file
14
modules/mod_roknavmenu/fields/childtype.js
Normal file
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* @version $Id: childtype.js 4758 2012-10-30 19:15:31Z djamil $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
window.addEvent("domready",function(){var f=document.id("jform_params_dropdown_children_type1")||document.id("jform_params_fusion_children_type1"),e=document.id("jform_params_dropdown_children_type2")||document.id("jform_params_fusion_children_type2"),b=document.id("jform_params_dropdown_children_type0")||document.id("jform_params_fusion_children_type0");
|
||||
var g=document.id("jform_params_dropdown_modules")||document.id("jform_params_fusion_modules"),d=document.id("jform_params_dropdown_module_positions")||document.id("jform_params_fusion_module_positions");
|
||||
if(g){var c=g.getParent("li")||g.getParent(".control-group");}if(d){var a=d.getParent("li")||d.getParent(".control-group");}if(f&&g){f.addEvent("click",function(){if(a){a.setStyle("display","none");
|
||||
}if(c){c.setStyle("display","block");}var h=c.getParent(".pane-slider");if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",c.getParent(".panelform").getSize().y);
|
||||
}}});}if(e&&d){e.addEvent("click",function(){if(c){c.setStyle("display","none");}if(a){a.setStyle("display","block");}var h=a.getParent(".pane-slider");
|
||||
if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",a.getParent(".panelform").getSize().y);}}});}if(b){b.addEvent("click",function(){if(c){c.setStyle("display","none");
|
||||
}if(a){a.setStyle("display","none");}var h=c.getParent(".pane-slider");if(h){if(h.getStyle("height").toInt()>0){h.setStyle("height",c.getParent(".panelform").getSize().y);
|
||||
}}});}if(b.checked){b.fireEvent("click");}if(f.checked){f.fireEvent("click");}if(e.checked){e.fireEvent("click");}});
|
1
modules/mod_roknavmenu/fields/index.html
Normal file
1
modules/mod_roknavmenu/fields/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
92
modules/mod_roknavmenu/fields/moduleposition.php
Normal file
92
modules/mod_roknavmenu/fields/moduleposition.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: moduleposition.php 4795 2012-10-30 23:22:49Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.form.formfield');
|
||||
JFormHelper::loadFieldClass('text');
|
||||
|
||||
/**
|
||||
* Supports a modal article picker.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldModulePosition extends JFormFieldText
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'ModulePosition';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('mod_roknavmenu', JPATH_BASE, null, false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', null, false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_BASE, $lang->getDefault(), false, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', $lang->getDefault(), false, false);
|
||||
|
||||
// Get the client id.
|
||||
$clientId = $this->element['client_id'];
|
||||
if (!isset($clientId))
|
||||
{
|
||||
$clientName = $this->element['client'];
|
||||
if (isset($clientName))
|
||||
{
|
||||
$client = JApplicationHelper::getClientInfo($clientName, true);
|
||||
$clientId = $client->id;
|
||||
}
|
||||
}
|
||||
if (!isset($clientId) && $this->form instanceof JForm) {
|
||||
$clientId = $this->form->getValue('client_id');
|
||||
}
|
||||
$clientId = (int) $clientId;
|
||||
|
||||
// Load the modal behavior script.
|
||||
JHtml::_('behavior.modal', 'a.modal');
|
||||
|
||||
// Build the script.
|
||||
$script = array();
|
||||
$script[] = ' function jSelectPosition_'.$this->id.'(name) {';
|
||||
$script[] = ' document.id("'.$this->id.'").value = name;';
|
||||
$script[] = ' SqueezeBox.close();';
|
||||
$script[] = ' }';
|
||||
|
||||
// Add the script to the document head.
|
||||
JFactory::getDocument()->addScriptDeclaration(implode("\n", $script));
|
||||
|
||||
// Setup variables for display.
|
||||
$html = array();
|
||||
$link = 'index.php?option=com_modules&view=positions&layout=modal&tmpl=component&function=jSelectPosition_'.$this->id.'&client_id='.$clientId;
|
||||
|
||||
// The current user display field.
|
||||
$html[] = '<div class="fltlft">';
|
||||
$html[] = parent::getInput();
|
||||
$html[] = '</div>';
|
||||
|
||||
// The user select button.
|
||||
$html[] = '<div class="button2-left">';
|
||||
$html[] = ' <div class="blank">';
|
||||
$html[] = ' <a class="modal" title="'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'</a>';
|
||||
$html[] = ' </div>';
|
||||
$html[] = '</div>';
|
||||
|
||||
return implode("\n", $html);
|
||||
}
|
||||
}
|
60
modules/mod_roknavmenu/fields/modules.php
Normal file
60
modules/mod_roknavmenu/fields/modules.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: modules.php 4585 2012-10-27 01:44:54Z btowles $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
defined('JPATH_BASE') or die();
|
||||
|
||||
jimport('joomla.html.html');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
/**
|
||||
* @package gantry
|
||||
* @subpackage admin.elements
|
||||
*/
|
||||
class JFormFieldModules extends JFormFieldList
|
||||
{
|
||||
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'modules';
|
||||
|
||||
/**
|
||||
* Method to get the field options.
|
||||
*
|
||||
* @return array The field option objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
|
||||
$options = array();
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, title, module, position');
|
||||
$query->from('#__modules AS m');
|
||||
$query->where('m.client_id = 0');
|
||||
$query->order('position, ordering');
|
||||
|
||||
// Set the query
|
||||
$db->setQuery($query);
|
||||
if (!($modules = $db->loadObjectList())) {
|
||||
JError::raiseWarning(500, JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $db->getErrorMsg()));
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach($modules as $module){
|
||||
$options[] = JHtml::_('select.option', $module->id, $module->title . ' (' . $module->module . ')');
|
||||
}
|
||||
|
||||
// Merge any additional options in the XML definition.
|
||||
$options = array_merge(parent::getOptions(), $options);
|
||||
return $options;
|
||||
|
||||
}
|
||||
}
|
52
modules/mod_roknavmenu/fields/moduletypejs.php
Normal file
52
modules/mod_roknavmenu/fields/moduletypejs.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: moduletypejs.php 4806 2012-10-31 01:03:01Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.form.formfield');
|
||||
|
||||
/**
|
||||
* Supports a modal article picker.
|
||||
*
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_content
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldModuleTypeJS extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $type = 'ModuleTypeJS';
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
$lang = JFactory::getLanguage();
|
||||
$lang->load('mod_roknavmenu', JPATH_SITE, null, true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', null, true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE, $lang->getDefault(), true, false)
|
||||
|| $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', $lang->getDefault(), true, false);
|
||||
|
||||
$doc =JFactory::getDocument();
|
||||
$doc->addScript(JURI::Root(true)."/modules/mod_roknavmenu/fields/childtype.js");
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function getLabel(){
|
||||
return '';
|
||||
}
|
||||
}
|
111
modules/mod_roknavmenu/fields/themelist.php
Normal file
111
modules/mod_roknavmenu/fields/themelist.php
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* @version 2.0.7 November 5, 2013
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.filesystem.folder');
|
||||
jimport('joomla.form.formfield');
|
||||
jimport('joomla.form.helper');
|
||||
JFormHelper::loadFieldClass('list');
|
||||
|
||||
/**
|
||||
* Supports an HTML select list of folder
|
||||
*
|
||||
* @package Joomla.Framework
|
||||
* @subpackage Form
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldThemeList extends JFormFieldList
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'ThemeList';
|
||||
|
||||
protected $_front_side_template;
|
||||
|
||||
/**
|
||||
* Method to get the field options.
|
||||
*
|
||||
* @return array The field option objects.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$doc =JFactory::getDocument();
|
||||
$version = new JVersion();
|
||||
|
||||
if (version_compare($version->getShortVersion(), '3.0', '<')){
|
||||
|
||||
$js = "window.addEvent('load', function() {
|
||||
$('" . $this->id . "').addEvent('change', function(){
|
||||
var sel = this.getSelected().get('value');
|
||||
$$('.themeset').setStyle('display','none');
|
||||
$$('#themeset-'+sel).setStyle('display','block');
|
||||
}).fireEvent('change');
|
||||
});";
|
||||
|
||||
} else {
|
||||
$js = "
|
||||
window.addEvent('load', function() {
|
||||
var chzn = $('" . $this->id . "_chzn');
|
||||
if(chzn!=null){
|
||||
$$('.themeset').setStyle('display','none');
|
||||
$$('#themeset-" . $this->value . "').setStyle('display','block');
|
||||
$('" . $this->id . "_chzn').addEvent('click', function(){
|
||||
$$('.themeset').setStyle('display','none');
|
||||
var text = $('" . $this->id . "_chzn').getElement('span').get('text');
|
||||
var options = $('" . $this->id . "').getElements('option');
|
||||
options.each(function(option) {
|
||||
var optText = String(option.get('text'));
|
||||
var optValue = String(option.get('value'));
|
||||
if(text == optText){
|
||||
var sel = '#themeset-'+optValue;
|
||||
}
|
||||
$$(sel).setStyle('display','block');
|
||||
});
|
||||
}).fireEvent('click');
|
||||
}
|
||||
});";
|
||||
}
|
||||
$doc->addScriptDeclaration($js);
|
||||
|
||||
$options = array();
|
||||
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokNavMenu.php");
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
foreach (RokNavMenu::$themes as $theme_name => $theme_info)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', $theme_name, $theme_info['fullname']);
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
function _getFrontSideTemplate() {
|
||||
if (empty($this->_front_side_template)) {
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true);
|
||||
// Get the current default template
|
||||
$query->select('template');
|
||||
$query->from('#__template_styles');
|
||||
$query->where('client_id = 0 AND home = 1');
|
||||
$db->setQuery((string)$query);
|
||||
$defaultemplate = $db->loadResult();
|
||||
$this->_front_side_template = $defaultemplate;
|
||||
}
|
||||
return $this->_front_side_template;
|
||||
}
|
||||
}
|
100
modules/mod_roknavmenu/fields/themeoptions.php
Normal file
100
modules/mod_roknavmenu/fields/themeoptions.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: themeoptions.php 4597 2012-10-27 04:37:59Z steph $
|
||||
* @author RocketTheme http://www.rockettheme.com
|
||||
* @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
|
||||
*/
|
||||
|
||||
defined('JPATH_BASE') or die;
|
||||
|
||||
jimport('joomla.html.html');
|
||||
jimport('joomla.filesystem.folder');
|
||||
jimport('joomla.form.formfield');
|
||||
jimport('joomla.form.helper');
|
||||
JHtml::_('behavior.framework', true);
|
||||
|
||||
/**
|
||||
* Supports an HTML select list of folder
|
||||
*
|
||||
* @package Joomla.Framework
|
||||
* @subpackage Form
|
||||
* @since 1.6
|
||||
*/
|
||||
class JFormFieldThemeOptions extends JFormField
|
||||
{
|
||||
/**
|
||||
* The form field type.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
public $type = 'ThemeOptions';
|
||||
|
||||
public function __construct($form = null){
|
||||
parent::__construct($form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the field input markup.
|
||||
*
|
||||
* @return string The field input markup.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getLabel()
|
||||
{
|
||||
$doc =JFactory::getDocument();
|
||||
$css="
|
||||
.rok-break {border-bottom:1px solid #eee;font-size:16px;color:#0088CC;margin-top:15px;padding:2px 0;width:100%;}
|
||||
div.themeset > div.control-label {margin-bottom:18px}
|
||||
div.themeset > div.controls {margin-bottom:18px}
|
||||
";
|
||||
$doc->addStyleDeclaration($css);
|
||||
|
||||
// Load SubfieldForm Class
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokSubfieldForm.php");
|
||||
|
||||
// Load 2x Catalog Themes
|
||||
require_once(JPATH_ROOT . "/modules/mod_roknavmenu/lib/RokNavMenu.php");
|
||||
RokNavMenu::loadCatalogs();
|
||||
|
||||
$label = JText::_((string)$this->element['label']);
|
||||
$css = (string)$this->element['class'];
|
||||
|
||||
$buffer = '';
|
||||
$form = RokSubfieldForm::getInstanceFromForm($this->form);
|
||||
|
||||
JForm::addFieldPath(dirname(__FILE__) . '/fields');
|
||||
|
||||
$themesets = $form->getSubFieldsets('roknavmenu-themes');
|
||||
|
||||
foreach($themesets as $themeset => $themeset_val)
|
||||
{
|
||||
$themeset_fields = $form->getSubFieldset('roknavmenu-themes', $themeset, 'params');
|
||||
ob_start();
|
||||
?>
|
||||
<div class="control-group themeset" id="themeset-<?php echo $themeset;?>">
|
||||
<?php foreach ($themeset_fields as $themeset_field): ?>
|
||||
<div class="control-label">
|
||||
<?php echo $themeset_field->getLabel(); ?>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<?php echo $themeset_field->getInput(); ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php
|
||||
$buffer .= ob_get_clean();
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function getInput()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user