first commit

This commit is contained in:
2026-02-08 21:16:11 +01:00
commit e17b7026fd
8881 changed files with 1160453 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
<?php
/**
* @copyright Copyright (C) 2017 Cedric KEIFLIN alias ced1870
* http://www.joomlack.fr
* @license GNU/GPL
* */
defined('JPATH_PLATFORM') or die;
if (!defined('MOBILEMENUCK_MEDIA_URI'))
{
define('MOBILEMENUCK_MEDIA_URI', JUri::root(true) . '/media/com_mobilemenuck');
}
JText::script('MOD_MOBILEMENUCK_SAVE_CLOSE');
class JFormFieldCkmoduleselect extends JFormField
{
protected $type = 'ckmoduleselect';
private $activate = true;
function __construct($form = null) {
if (! \Mobilemenuck\Helper::checkIsProVersion()) $this->activate = false;
parent::__construct($form);
}
protected function getInput() {
if (! $this->activate) {
$html = \Mobilemenuck\Helper::renderProMessage();
return $html;
}
$doc = JFactory::getDocument();
$doc->addStylesheet(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.css');
$doc->addScript(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.js');
// Initialize some field attributes.
$js = 'function ckMobilemenuSelectModule(id, name, close) {
if (!close && close != false) close = true;
jQuery("#' . $this->id . '").val(id).trigger(\'change\');
jQuery("#' . $this->id . 'name").val(name);
if (close) CKBox.close();
}
function ckMobilemenuUpdateModule(nothing, id, name) {
ckMobilemenuSelectModule(id, name, false);
}';
$doc->addScriptDeclaration($js);
$icon = $this->element['icon'];
$suffix = $this->element['suffix'];
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : 'class="form-control"';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$defautlwidth = $suffix ? '128px' : '150px';
$styles = ' style="width:'.$defautlwidth.';'.$this->element['styles'].'"';
$module = \Mobilemenuck\Helper::getModuleById($this->value);
$title = isset($module->title) ? $module->title : '';
// Initialize JavaScript field attributes.
$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
$html = $icon ? '<div style="display:inline-block;vertical-align:top;margin-top:4px;width:20px;"><img src="' . MOBILEMENUCK_MEDIA_URI . '/images/' . $icon . '" style="margin-right:5px;" /></div>' : '';
$html .= '<div class="btn-group">';
$html .= '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<input type="text" disabled name="' . $this->name . 'name" id="' . $this->id . 'name"' . ' value="'
. htmlspecialchars($title) . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<div class="btn btn-outline-secondary" onclick="CKBox.open({url: \'index.php?option=com_mobilemenuck&view=items&tmpl=component&layout=select&returnFunc=ckMobilemenuSelectModule\'})"><i class="fas fa-mouse-pointer"></i> ' . JText::_('PLG_MOBILEMENUCK_SELECT') . '</div>';
// $html .= '<div class="btn btn-secondary" onclick="if (jQuery(\'#' . $this->id . '\').val()) {CKBox.open({url: \'index.php?option=com_mobilemenuck&view=style&tmpl=component&modal=1&id=\'+jQuery(\'#' . $this->id . '\').val()+\'\'}) } else { alert(\'' . JText::_('PLG_MOBILEMENUCK_SELECT_FIRST', true) . '\');}">' . JText::_('PLG_MOBILEMENUCK_EDIT', true) . '</div>';
$html .= '<div class="btn btn-outline-secondary" onclick="jQuery(\'#' . $this->id . '\').val(\'\').trigger(\'change\');jQuery(\'#' . $this->id . 'name\').val(\'\');"><i class="fas fa-times"></i> ' . JText::_('PLG_MOBILEMENUCK_CLEAR', true) . '</div>';
$html .= '</div>';
return $html;
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* @copyright Copyright (C) 2017 Cedric KEIFLIN alias ced1870
* http://www.joomlack.fr
* @license GNU/GPL
* */
defined('JPATH_PLATFORM') or die;
if (!defined('MOBILEMENUCK_MEDIA_URI'))
{
define('MOBILEMENUCK_MEDIA_URI', JUri::root(true) . '/media/com_mobilemenuck');
}
JText::script('MOD_MOBILEMENUCK_SAVE_CLOSE');
class JFormFieldCkstyleselect extends JFormField
{
protected $type = 'ckstyleselect';
private $activate = true;
function __construct($form = null) {
require_once(MOBILEMENUCK_PATH . '/helpers/helper.php');
if (! \Mobilemenuck\Helper::checkIsProVersion()) $this->activate = false;
parent::__construct($form);
}
protected function getInput() {
if (! $this->activate) {
$html = \Mobilemenuck\Helper::renderProMessage();
return $html;
}
$doc = JFactory::getDocument();
$doc->addStylesheet(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.css');
$doc->addScript(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.js');
// Initialize some field attributes.
$js = 'function ckMobilemenuSelectStyle(id, name, close) {
if (!close && close != false) close = true;
jQuery("#' . $this->id . '").val(id);
jQuery("#' . $this->id . 'name").val(name);
if (close) CKBox.close();
}
function ckMobilemenuUpdateStyle(nothing, id, name) {
ckMobilemenuSelectStyle(id, name, false);
}';
$doc->addScriptDeclaration($js);
$icon = $this->element['icon'];
$suffix = $this->element['suffix'];
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : 'class="form-control"';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$defautlwidth = $suffix ? '128px' : '150px';
$styles = ' style="width:'.$defautlwidth.';'.$this->element['styles'].'"';
$styleName = \Mobilemenuck\Helper::getStyleNameById($this->value);
// Initialize JavaScript field attributes.
$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
$html = $icon ? '<div style="display:inline-block;vertical-align:top;margin-top:4px;width:20px;"><img src="' . MOBILEMENUCK_MEDIA_URI . '/images/' . $icon . '" style="margin-right:5px;" /></div>' : '';
$html .= '<div class="btn-group">';
$html .= '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<input type="text" disabled name="' . $this->name . 'name" id="' . $this->id . 'name"' . ' value="'
. htmlspecialchars($styleName) . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<div class="btn btn-primary" onclick="CKBox.open({url: \'index.php?option=com_mobilemenuck&view=styles&tmpl=component&modal=1&returnFunc=ckMobilemenuSelectStyle\'})">' . JText::_('PLG_MOBILEMENUCK_SELECT') . '</div>';
$html .= '<div class="btn btn-secondary" onclick="if (jQuery(\'#' . $this->id . '\').val()) {CKBox.open({url: \'index.php?option=com_mobilemenuck&view=style&tmpl=component&modal=1&id=\'+jQuery(\'#' . $this->id . '\').val()+\'\'}) } else { alert(\'' . JText::_('PLG_MOBILEMENUCK_SELECT_FIRST', true) . '\');}">' . JText::_('PLG_MOBILEMENUCK_EDIT', true) . '</div>';
$html .= '<div class="btn btn-light" onclick="jQuery(\'#' . $this->id . '\').val(\'\');jQuery(\'#' . $this->id . 'name\').val(\'\');">' . JText::_('PLG_MOBILEMENUCK_CLEAR', true) . '</div>';
$html .= '</div>';
return $html;
}
}

View File

@@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@@ -0,0 +1,77 @@
<?php
/**
* @copyright Copyright (C) 2017 Cedric KEIFLIN alias ced1870
* http://www.joomlack.fr
* @license GNU/GPL
* */
defined('JPATH_PLATFORM') or die;
if (!defined('MOBILEMENUCK_MEDIA_URI'))
{
define('MOBILEMENUCK_MEDIA_URI', JUri::root(true) . '/media/com_mobilemenuck');
}
JText::script('MOD_MOBILEMENUCK_SAVE_CLOSE');
class JFormFieldMobilemenuckicon extends JFormField
{
protected $type = 'mobilemenuckicon';
private $activate = true;
function __construct($form = null) {
require_once(MOBILEMENUCK_PATH . '/helpers/helper.php');
if (! \Mobilemenuck\Helper::checkIsProVersion()) $this->activate = false;
parent::__construct($form);
}
protected function getInput() {
if (! $this->activate) {
$html = \Mobilemenuck\Helper::renderProMessage();
return $html;
}
$doc = JFactory::getDocument();
$doc->addStylesheet(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.css');
$doc->addScript(MOBILEMENUCK_MEDIA_URI . '/assets/ckbox.js');
// Initialize some field attributes.
$js = 'function ckMobilemenuSelectStyle(id, name, close) {
if (!close && close != false) close = true;
jQuery("#' . $this->id . '").val(id);
jQuery("#' . $this->id . 'name").val(name);
if (close) CKBox.close();
}
function ckMobilemenuUpdateStyle(nothing, id, name) {
ckMobilemenuSelectStyle(id, name, false);
}';
$doc->addScriptDeclaration($js);
$icon = $this->element['icon'];
$suffix = $this->element['suffix'];
$size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
$maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
$class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : 'class="form-control"';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$defautlwidth = $suffix ? '128px' : '150px';
$styles = ' style="width:'.$defautlwidth.';'.$this->element['styles'].'"';
$styleName = \Mobilemenuck\Helper::getStyleNameById($this->value);
// Initialize JavaScript field attributes.
$onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
$html = $icon ? '<div style="display:inline-block;vertical-align:top;margin-top:4px;width:20px;"><img src="' . MOBILEMENUCK_MEDIA_URI . '/images/' . $icon . '" style="margin-right:5px;" /></div>' : '';
$html .= '<div class="btn-group">';
$html .= '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="'
. htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<input type="text" disabled name="' . $this->name . 'name" id="' . $this->id . 'name"' . ' value="'
. htmlspecialchars($styleName) . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . $styles . '/>';
$html .= '<div class="btn btn-outline-secondary" onclick="CKBox.open({url: \'index.php?option=com_mobilemenuck&view=styles&tmpl=component&modal=1&returnFunc=ckMobilemenuSelectStyle\'})"><i class="fas fa-mouse-pointer "></i> ' . JText::_('PLG_MOBILEMENUCK_SELECT') . '</div>';
$html .= '<div class="btn btn-outline-secondary" onclick="if (jQuery(\'#' . $this->id . '\').val()) {CKBox.open({url: \'index.php?option=com_mobilemenuck&view=style&tmpl=component&modal=1&id=\'+jQuery(\'#' . $this->id . '\').val()+\'\'}) } else { alert(\'' . JText::_('PLG_MOBILEMENUCK_SELECT_FIRST', true) . '\');}"><i class="fas fa-edit"></i> ' . JText::_('PLG_MOBILEMENUCK_EDIT', true) . '</div>';
$html .= '<div class="btn btn-outline-secondary" onclick="jQuery(\'#' . $this->id . '\').val(\'\');jQuery(\'#' . $this->id . 'name\').val(\'\');"><i class="fas fa-times"></i> ' . JText::_('PLG_MOBILEMENUCK_CLEAR', true) . '</div>';
$html .= '</div>';
return $html;
}
}

View File

@@ -0,0 +1,63 @@
<?php
/**
* @copyright Copyright (C) 2017 Cedric KEIFLIN alias ced1870
* http://www.joomlack.fr
* @license GNU/GPL
* */
defined('JPATH_PLATFORM') or die;
class JFormFieldMobilemenuckinfo extends JFormField
{
/**
* The form field type.
*
* @var string
*
*/
protected $type = 'mobilemenuckinfo';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
*/
protected function getLabel()
{
return '';
}
/**
* Method to get the field label markup.
*
* @return string The field label markup.
*
*/
protected function getInput()
{
$doc = JFactory::getDocument();
$styles = '.mobilemenuck-info {position:relative;background:#efefef;border: none;border-radius: px;color: #333;font-weight: normal;line-height: 24px;padding: 5px 5px 5px 35px;margin: 3px 0;text-align: left;text-decoration: none;height:100%;}
.mobilemenuck-info .mobilemenuck-info-icon {
margin: 0 10px 0 0;
padding: 3px 5px;
background: rgba(0, 0, 0, 0.1);
position: absolute;
top: 0;
bottom: 0;
left: 0;
line-height: 25px;
width: 30px;
height: 100%;
text-align: center;}
.mobilemenuck-info-icon svg {
max-width: 25px;
max-height: 20px;
vertical-align: bottom;
}
.control-label:empty, .controls:empty {display: none;}
.control-label:empty + .controls {margin: 0;}
';
$doc->addStyleDeclaration($styles);
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* https://www.joomlack.fr
* @license GNU/GPL
* */
// no direct access
defined('_JEXEC') or die('Restricted access');
class JFormFieldMobilemenuckonlypro extends JFormField {
protected $type = 'mobilemenuckonlypro';
protected function getLabel() {
return '';
}
protected function getInput() {
// TODO : check si composant est installé ou pas si oui pas de message
$isPro = file_exists(JPATH_ROOT . '/administrator/components/com_mobilemenuck/mobilemenuck.php');
if ($isPro) return;
$icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z"/></svg>';
$html = '<div class="mobilemenuck-info">'
. '<div class="mobilemenuck-info-icon">' . $icon . '</div>'
. '<a href="https://www.joomlack.fr/en/joomla-extensions/mobile-menu-ck" target="_blank">' . JText::_('PLG_MOBILEMENUCK_PRO_ONLY') . '</a></div>';
return $html;
}
}

View File

@@ -0,0 +1,59 @@
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* https://www.joomlack.fr
* @license GNU/GPL
* */
// no direct access
defined('_JEXEC') or die('Restricted access');
class JFormFieldMobilemenuckspacer extends JFormField {
protected $type = 'mobilemenuckspacer';
protected function getLabel() {
return '';
}
protected function getInput() {
$html = array();
$class = $this->element['class'] ? (string) $this->element['class'] : '';
$style = $this->element['style'] ? $this->element['style'] : '';
if ($style == 'title') {
$doc = JFactory::getDocument();
$styles = '.ckinfo.cktitle {
background:#666;
color: #eee;
text-transform: uppercase;
font-weight: normal;
line-height: 24px;
padding: 8px 5px 8px 35px;
margin: 3px 0;
text-align: left;
text-decoration: none;
border-radius: 3px;
}
';
$doc->addStyleDeclaration($styles);
}
if ((string) $this->element['hr'] == 'true') {
$html[] = '<hr class="' . $class . '" />';
} else {
$label = '';
// Get the label text from the XML element, defaulting to the element name.
$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
$text = $this->translateLabel ? JText::_($text) : $text;
// set the icon
$icon = $this->element['icon'] ? $this->element['icon'] : 'info';
$html[] = '<div class="ckinfo' . ($style == 'title' ? ' cktitle' : '') . '">' . ($style == 'title' ? '' : '<i class="fas fa-' . $icon . '"></i>') . $text . '</div>';
}
return implode('', $html);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* https://www.joomlack.fr
* @license GNU/GPL
* */
// no direct access
defined('_JEXEC') or die('Restricted access');
class JFormFieldMobilemenuckvideo extends JFormField {
protected $type = 'mobilemenuckvideo';
protected function getLabel() {
return '';
}
protected function getInput() {
$url = $this->element['url'] ? (string) $this->element['url'] : '';
if (! $url) return '';
$icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M488 64h-8v20c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V64H96v20c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12V64h-8C10.7 64 0 74.7 0 88v336c0 13.3 10.7 24 24 24h8v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h320v-20c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v20h8c13.3 0 24-10.7 24-24V88c0-13.3-10.7-24-24-24zM96 372c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12H44c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm272 208c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm0-168c0 6.6-5.4 12-12 12H156c-6.6 0-12-5.4-12-12v-96c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v96zm112 152c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-96c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40z"/></svg>';
$html = '<div class="mobilemenuck-info">'
. '<div class="mobilemenuck-info-icon">' . $icon . '</div>'
. '<a target="_blank" href="' . $url . '" target="_blank">' . JText::_('PLG_MOBILEMENUCK_VIDEO_TUTORIAL') . '</a></div>';
return $html;
}
}