Current oav website
This commit is contained in:
39
dotclear._no/plugins/simpleMenu/_admin.php
Normal file
39
dotclear._no/plugins/simpleMenu/_admin.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {return;}
|
||||
|
||||
$core->addBehavior('adminDashboardIcons', 'simpleMenu_dashboard');
|
||||
$core->addBehavior('adminDashboardFavorites', 'simpleMenu_dashboard_favs');
|
||||
function simpleMenu_dashboard($core, $icons)
|
||||
{
|
||||
$icons['simpleMenu'] = new ArrayObject([__('Simple menu'),
|
||||
$core->adminurl->get('admin.plugin.simpleMenu'),
|
||||
dcPage::getPF('simpleMenu/icon.png')]);
|
||||
}
|
||||
function simpleMenu_dashboard_favs($core, $favs)
|
||||
{
|
||||
$favs->register('simpleMenu', [
|
||||
'title' => __('Simple menu'),
|
||||
'url' => $core->adminurl->get('admin.plugin.simpleMenu'),
|
||||
'small-icon' => dcPage::getPF('simpleMenu/icon-small.png'),
|
||||
'large-icon' => dcPage::getPF('simpleMenu/icon.png'),
|
||||
'permissions' => 'usage,contentadmin'
|
||||
]);
|
||||
}
|
||||
|
||||
$_menu['Blog']->addItem(__('Simple menu'),
|
||||
$core->adminurl->get('admin.plugin.simpleMenu'),
|
||||
dcPage::getPF('simpleMenu/icon-small.png'),
|
||||
preg_match('/' . preg_quote($core->adminurl->get('admin.plugin.simpleMenu')) . '(&.*)?$/', $_SERVER['REQUEST_URI']),
|
||||
$core->auth->check('usage,contentadmin', $core->blog->id));
|
||||
|
||||
require dirname(__FILE__) . '/_widgets.php';
|
||||
26
dotclear._no/plugins/simpleMenu/_define.php
Normal file
26
dotclear._no/plugins/simpleMenu/_define.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {return;}
|
||||
|
||||
$this->registerModule(
|
||||
"simpleMenu", // Name
|
||||
"Simple menu for Dotclear", // Description
|
||||
"Franck Paul", // Author
|
||||
'1.6', // Version
|
||||
[
|
||||
'permissions' => 'admin',
|
||||
'type' => 'plugin',
|
||||
'settings' => [
|
||||
'self' => ''
|
||||
]
|
||||
]
|
||||
);
|
||||
29
dotclear._no/plugins/simpleMenu/_install.php
Normal file
29
dotclear._no/plugins/simpleMenu/_install.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {return;}
|
||||
|
||||
$version = $core->plugins->moduleInfo('simpleMenu', 'version');
|
||||
if (version_compare($core->getVersion('simpleMenu'), $version, '>=')) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Menu par défaut
|
||||
$blog_url = html::stripHostURL($core->blog->url);
|
||||
$menu_default = [
|
||||
['label' => 'Home', 'descr' => 'Recent posts', 'url' => $blog_url, 'targetBlank' => false],
|
||||
['label' => 'Archives', 'descr' => '', 'url' => $blog_url . $core->url->getURLFor('archive'), 'targetBlank' => false]
|
||||
];
|
||||
$core->blog->settings->system->put('simpleMenu', $menu_default, 'array', 'simpleMenu default menu', false, true);
|
||||
$core->blog->settings->system->put('simpleMenu_active', true, 'boolean', 'Active', false, true);
|
||||
|
||||
$core->setVersion('simpleMenu', $version);
|
||||
return true;
|
||||
180
dotclear._no/plugins/simpleMenu/_public.php
Normal file
180
dotclear._no/plugins/simpleMenu/_public.php
Normal file
@ -0,0 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {return;}
|
||||
|
||||
require dirname(__FILE__) . '/_widgets.php';
|
||||
|
||||
# Simple menu template functions
|
||||
$core->tpl->addValue('SimpleMenu', ['tplSimpleMenu', 'simpleMenu']);
|
||||
|
||||
class tplSimpleMenu
|
||||
{
|
||||
# Template function
|
||||
public static function simpleMenu($attr)
|
||||
{
|
||||
global $core;
|
||||
|
||||
if (!(boolean) $core->blog->settings->system->simpleMenu_active) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$class = isset($attr['class']) ? trim($attr['class']) : '';
|
||||
$id = isset($attr['id']) ? trim($attr['id']) : '';
|
||||
$description = isset($attr['description']) ? trim($attr['description']) : '';
|
||||
|
||||
if (!preg_match('#^(title|span|both|none)$#', $description)) {
|
||||
$description = '';
|
||||
}
|
||||
|
||||
return '<?php echo tplSimpleMenu::displayMenu(' .
|
||||
"'" . addslashes($class) . "'," .
|
||||
"'" . addslashes($id) . "'," .
|
||||
"'" . addslashes($description) . "'" .
|
||||
'); ?>';
|
||||
}
|
||||
|
||||
# Widget function
|
||||
public static function simpleMenuWidget($w)
|
||||
{
|
||||
global $core, $_ctx;
|
||||
|
||||
$descr_type = [0 => 'span', 1 => 'title', 2 => 'both', 3 => 'none'];
|
||||
|
||||
if (!(boolean) $core->blog->settings->system->simpleMenu_active) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($w->offline) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (($w->homeonly == 1 && !$core->url->isHome($core->url->type)) ||
|
||||
($w->homeonly == 2 && $core->url->isHome($core->url->type))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$description = 'title';
|
||||
if (isset($descr_type[$w->description])) {
|
||||
$description = $descr_type[$w->description];
|
||||
}
|
||||
$menu = tplSimpleMenu::displayMenu('', '', $description);
|
||||
if ($menu == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
return $w->renderDiv($w->content_only, 'simple-menu ' . $w->class, '',
|
||||
($w->title ? $w->renderTitle(html::escapeHTML($w->title)) : '') . $menu);
|
||||
}
|
||||
|
||||
public static function displayMenu($class = '', $id = '', $description = '')
|
||||
{
|
||||
global $core;
|
||||
|
||||
$ret = '';
|
||||
|
||||
if (!(boolean) $core->blog->settings->system->simpleMenu_active) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$menu = $core->blog->settings->system->simpleMenu;
|
||||
if (is_array($menu)) {
|
||||
// Current relative URL
|
||||
$url = $_SERVER['REQUEST_URI'];
|
||||
$abs_url = http::getHost() . $url;
|
||||
|
||||
// Home recognition var
|
||||
$home_url = html::stripHostURL($core->blog->url);
|
||||
$home_directory = dirname($home_url);
|
||||
if ($home_directory != '/') {
|
||||
$home_directory = $home_directory . '/';
|
||||
}
|
||||
|
||||
// Menu items loop
|
||||
foreach ($menu as $i => $m) {
|
||||
# $href = lien de l'item de menu
|
||||
$href = $m['url'];
|
||||
$href = html::escapeHTML($href);
|
||||
|
||||
# Cope with request only URL (ie ?query_part)
|
||||
$href_part = '';
|
||||
if ($href != '' && substr($href, 0, 1) == '?') {
|
||||
$href_part = substr($href, 1);
|
||||
}
|
||||
|
||||
$targetBlank = ((isset($m['targetBlank'])) && ($m['targetBlank'])) ? true : false;
|
||||
|
||||
# Active item test
|
||||
$active = false;
|
||||
if (($url == $href) ||
|
||||
($abs_url == $href) ||
|
||||
($_SERVER['URL_REQUEST_PART'] == $href) ||
|
||||
(($href_part != '') && ($_SERVER['URL_REQUEST_PART'] == $href_part)) ||
|
||||
(($_SERVER['URL_REQUEST_PART'] == '') && (($href == $home_url) || ($href == $home_directory)))) {
|
||||
$active = true;
|
||||
}
|
||||
$title = $span = '';
|
||||
|
||||
if ($m['descr']) {
|
||||
if (($description == 'title' || $description == 'both') && $targetBlank) {
|
||||
$title = html::escapeHTML(__($m['descr'])) . ' (' .
|
||||
__('new window') . ')';
|
||||
} elseif ($description == 'title' || $description == 'both') {
|
||||
$title = html::escapeHTML(__($m['descr']));
|
||||
}
|
||||
if ($description == 'span' || $description == 'both') {
|
||||
$span = ' <span class="simple-menu-descr">' . html::escapeHTML(__($m['descr'])) . '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($title) && $targetBlank) {
|
||||
$title = __('new window');
|
||||
}
|
||||
if ($active && !$targetBlank) {
|
||||
$title = (empty($title) ? __('Active page') : $title . ' (' . __('active page') . ')');
|
||||
}
|
||||
|
||||
$label = html::escapeHTML(__($m['label']));
|
||||
|
||||
$item = new ArrayObject([
|
||||
'url' => $href, // URL
|
||||
'label' => $label, // <a> link label
|
||||
'title' => $title, // <a> link title (optional)
|
||||
'span' => $span, // description (will be displayed after <a> link)
|
||||
'active' => $active, // status (true/false)
|
||||
'class' => '' // additional <li> class (optional)
|
||||
]);
|
||||
|
||||
# --BEHAVIOR-- publicSimpleMenuItem
|
||||
$core->callBehavior('publicSimpleMenuItem', $i, $item);
|
||||
|
||||
$ret .= '<li class="li' . ($i + 1) .
|
||||
($item['active'] ? ' active' : '') .
|
||||
($i == 0 ? ' li-first' : '') .
|
||||
($i == count($menu) - 1 ? ' li-last' : '') .
|
||||
($item['class'] ? ' ' . $item['class'] : '') .
|
||||
'">' .
|
||||
'<a href="' . $href . '"' .
|
||||
(!empty($item['title']) ? ' title="'. $label . ' - ' . $item['title'] . '"' : '') .
|
||||
(($targetBlank) ? ' target="_blank" rel="noopener noreferrer"' : '') . '>' .
|
||||
'<span class="simple-menu-label">' . $item['label'] . '</span>' .
|
||||
$item['span'] . '</a>' .
|
||||
'</li>';
|
||||
}
|
||||
// Final rendering
|
||||
if ($ret) {
|
||||
$ret = '<nav role="navigation"><ul ' . ($id ? 'id="' . $id . '"' : '') . ' class="simple-menu' . ($class ? ' ' . $class : '') . '">' . "\n" . $ret . "\n" . '</ul></nav>';
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
35
dotclear._no/plugins/simpleMenu/_widgets.php
Normal file
35
dotclear._no/plugins/simpleMenu/_widgets.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_RC_PATH')) {return;}
|
||||
|
||||
$core->addBehavior('initWidgets', ['simpleMenuWidgets', 'initWidgets']);
|
||||
|
||||
class simpleMenuWidgets
|
||||
{
|
||||
public static function initWidgets($w)
|
||||
{
|
||||
$w
|
||||
->create('simplemenu', __('Simple menu'), ['tplSimpleMenu', 'simpleMenuWidget'], null, 'List of simple menu items')
|
||||
->addTitle(__('Menu'))
|
||||
->setting('description', __('Item description'), 0, 'combo',
|
||||
[
|
||||
__('Displayed in link') => 0, // span
|
||||
__('Used as link title') => 1, // title
|
||||
__('Displayed in link and used as title') => 2, // both
|
||||
__('Not displayed nor used') => 3 // none
|
||||
])
|
||||
->addHomeOnly()
|
||||
->addContentOnly()
|
||||
->addClass()
|
||||
->addOffline();
|
||||
}
|
||||
}
|
||||
BIN
dotclear._no/plugins/simpleMenu/icon-small.png
Normal file
BIN
dotclear._no/plugins/simpleMenu/icon-small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 B |
BIN
dotclear._no/plugins/simpleMenu/icon.png
Normal file
BIN
dotclear._no/plugins/simpleMenu/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 B |
625
dotclear._no/plugins/simpleMenu/index.php
Normal file
625
dotclear._no/plugins/simpleMenu/index.php
Normal file
@ -0,0 +1,625 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief simpleMenu, a plugin for Dotclear 2
|
||||
*
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!defined('DC_CONTEXT_ADMIN')) {return;}
|
||||
|
||||
dcPage::check('admin');
|
||||
|
||||
$page_title = __('Simple menu');
|
||||
|
||||
# Url de base
|
||||
$p_url = $core->adminurl->get('admin.plugin.simpleMenu');
|
||||
|
||||
# Url du blog
|
||||
$blog_url = html::stripHostURL($core->blog->url);
|
||||
|
||||
# Liste des catégories
|
||||
$categories_label = [];
|
||||
$rs = $core->blog->getCategories(['post_type' => 'post']);
|
||||
$categories_combo = dcAdminCombos::getCategoriesCombo($rs, false, true);
|
||||
$rs->moveStart();
|
||||
while ($rs->fetch()) {
|
||||
$categories_label[$rs->cat_url] = html::escapeHTML($rs->cat_title);
|
||||
}
|
||||
|
||||
# Liste des langues utilisées
|
||||
$langs_combo = dcAdminCombos::getLangscombo(
|
||||
$core->blog->getLangs(['order' => 'asc'])
|
||||
);
|
||||
|
||||
# Liste des mois d'archive
|
||||
$rs = $core->blog->getDates(['type' => 'month']);
|
||||
$months_combo = array_merge(
|
||||
[__('All months') => '-'],
|
||||
dcAdmincombos::getDatesCombo($rs)
|
||||
);
|
||||
|
||||
$first_year = $last_year = 0;
|
||||
while ($rs->fetch()) {
|
||||
if (($first_year == 0) || ($rs->year() < $first_year)) {
|
||||
$first_year = $rs->year();
|
||||
}
|
||||
|
||||
if (($last_year == 0) || ($rs->year() > $last_year)) {
|
||||
$last_year = $rs->year();
|
||||
}
|
||||
|
||||
}
|
||||
unset($rs);
|
||||
|
||||
# Liste des pages -- Doit être pris en charge plus tard par le plugin ?
|
||||
$pages_combo = [];
|
||||
try {
|
||||
$rs = $core->blog->getPosts(['post_type' => 'page']);
|
||||
while ($rs->fetch()) {
|
||||
$pages_combo[$rs->post_title] = $rs->getURL();
|
||||
}
|
||||
unset($rs);
|
||||
} catch (Exception $e) {}
|
||||
|
||||
# Liste des tags -- Doit être pris en charge plus tard par le plugin ?
|
||||
$tags_combo = [];
|
||||
try {
|
||||
$rs = $core->meta->getMetadata(['meta_type' => 'tag']);
|
||||
$tags_combo[__('All tags')] = '-';
|
||||
while ($rs->fetch()) {
|
||||
$tags_combo[$rs->meta_id] = $rs->meta_id;
|
||||
}
|
||||
unset($rs);
|
||||
} catch (Exception $e) {}
|
||||
|
||||
# Liste des types d'item de menu
|
||||
$items = new ArrayObject();
|
||||
$items['home'] = new ArrayObject([__('Home'), false]);
|
||||
|
||||
if ($core->blog->settings->system->static_home) {
|
||||
$items['posts'] = new ArrayObject([__('Posts'), false]);
|
||||
}
|
||||
|
||||
if (count($langs_combo) > 1) {
|
||||
$items['lang'] = new ArrayObject([__('Language'), true]);
|
||||
}
|
||||
if (count($categories_combo)) {
|
||||
$items['category'] = new ArrayObject([__('Category'), true]);
|
||||
}
|
||||
if (count($months_combo) > 1) {
|
||||
$items['archive'] = new ArrayObject([__('Archive'), true]);
|
||||
}
|
||||
if ($core->plugins->moduleExists('pages')) {
|
||||
if (count($pages_combo)) {
|
||||
$items['pages'] = new ArrayObject([__('Page'), true]);
|
||||
}
|
||||
|
||||
}
|
||||
if ($core->plugins->moduleExists('tags')) {
|
||||
if (count($tags_combo) > 1) {
|
||||
$items['tags'] = new ArrayObject([__('Tags'), true]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# --BEHAVIOR-- adminSimpleMenuAddType
|
||||
# Should add an item to $items[<id>] as an [<label>,<optional step (true or false)>]
|
||||
$core->callBehavior('adminSimpleMenuAddType', $items);
|
||||
|
||||
$items['special'] = new ArrayObject([__('User defined'), false]);
|
||||
|
||||
$items_combo = [];
|
||||
foreach ($items as $k => $v) {
|
||||
$items_combo[$v[0]] = $k;
|
||||
}
|
||||
|
||||
# Lecture menu existant
|
||||
$menu = $core->blog->settings->system->get('simpleMenu');
|
||||
if (!is_array($menu)) {
|
||||
$menu = [];
|
||||
}
|
||||
|
||||
# Récupération état d'activation du menu
|
||||
$menu_active = (boolean) $core->blog->settings->system->simpleMenu_active;
|
||||
|
||||
// Saving new configuration
|
||||
if (!empty($_POST['saveconfig'])) {
|
||||
try
|
||||
{
|
||||
$menu_active = (empty($_POST['active'])) ? false : true;
|
||||
$core->blog->settings->system->put('simpleMenu_active', $menu_active, 'boolean');
|
||||
$core->blog->triggerBlog();
|
||||
|
||||
// All done successfully, return to menu items list
|
||||
dcPage::addSuccessNotice(__('Configuration successfully updated.'));
|
||||
http::redirect($p_url);
|
||||
} catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
} else {
|
||||
# Récupération paramètres postés
|
||||
$item_type = isset($_POST['item_type']) ? $_POST['item_type'] : '';
|
||||
$item_select = isset($_POST['item_select']) ? $_POST['item_select'] : '';
|
||||
$item_label = isset($_POST['item_label']) ? $_POST['item_label'] : '';
|
||||
$item_descr = isset($_POST['item_descr']) ? $_POST['item_descr'] : '';
|
||||
$item_url = isset($_POST['item_url']) ? $_POST['item_url'] : '';
|
||||
$item_targetBlank = isset($_POST['item_targetBlank']) ? (empty($_POST['item_targetBlank'])) ? false : true : false;
|
||||
# Traitement
|
||||
$step = (!empty($_GET['add']) ? (integer) $_GET['add'] : 0);
|
||||
if (($step > 4) || ($step < 0)) {
|
||||
$step = 0;
|
||||
}
|
||||
|
||||
if ($step) {
|
||||
|
||||
# Récupération libellés des choix
|
||||
$item_type_label = isset($items[$item_type]) ? $items[$item_type][0] : '';
|
||||
|
||||
switch ($step) {
|
||||
case 1:
|
||||
// First step, menu item type to be selected
|
||||
$item_type = $item_select = '';
|
||||
break;
|
||||
case 2:
|
||||
if ($items[$item_type][1]) {
|
||||
// Second step (optional), menu item sub-type to be selected
|
||||
$item_select = '';
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
// Third step, menu item attributes to be changed or completed if necessary
|
||||
$item_select_label = '';
|
||||
$item_label = __('Label');
|
||||
$item_descr = __('Description');
|
||||
$item_url = $blog_url;
|
||||
switch ($item_type) {
|
||||
case 'home':
|
||||
$item_label = __('Home');
|
||||
$item_descr = $core->blog->settings->system->static_home ? __('Home page') : __('Recent posts');
|
||||
break;
|
||||
case 'posts':
|
||||
$item_label = __('Posts');
|
||||
$item_descr = __('Recent posts');
|
||||
$item_url .= $core->url->getURLFor('posts');
|
||||
break;
|
||||
case 'lang':
|
||||
$item_select_label = array_search($item_select, $langs_combo);
|
||||
$item_label = $item_select_label;
|
||||
$item_descr = sprintf(__('Switch to %s language'), $item_select_label);
|
||||
$item_url .= $core->url->getURLFor('lang', $item_select);
|
||||
break;
|
||||
case 'category':
|
||||
$item_select_label = $categories_label[$item_select];
|
||||
$item_label = $item_select_label;
|
||||
$item_descr = __('Recent Posts from this category');
|
||||
$item_url .= $core->url->getURLFor('category', $item_select);
|
||||
break;
|
||||
case 'archive':
|
||||
$item_select_label = array_search($item_select, $months_combo);
|
||||
if ($item_select == '-') {
|
||||
$item_label = __('Archives');
|
||||
$item_descr = $first_year . ($first_year != $last_year ? ' - ' . $last_year : '');
|
||||
$item_url .= $core->url->getURLFor('archive');
|
||||
} else {
|
||||
$item_label = $item_select_label;
|
||||
$item_descr = sprintf(__('Posts from %s'), $item_select_label);
|
||||
$item_url .= $core->url->getURLFor('archive', substr($item_select, 0, 4) . '/' . substr($item_select, -2));
|
||||
}
|
||||
break;
|
||||
case 'pages':
|
||||
$item_select_label = array_search($item_select, $pages_combo);
|
||||
$item_label = $item_select_label;
|
||||
$item_descr = '';
|
||||
$item_url = html::stripHostURL($item_select);
|
||||
break;
|
||||
case 'tags':
|
||||
$item_select_label = array_search($item_select, $tags_combo);
|
||||
if ($item_select == '-') {
|
||||
$item_label = __('All tags');
|
||||
$item_descr = '';
|
||||
$item_url .= $core->url->getURLFor('tags');
|
||||
} else {
|
||||
$item_label = $item_select_label;
|
||||
$item_descr = sprintf(__('Recent posts for %s tag'), $item_select_label);
|
||||
$item_url .= $core->url->getURLFor('tag', $item_select);
|
||||
}
|
||||
break;
|
||||
case 'special':
|
||||
break;
|
||||
default:
|
||||
# --BEHAVIOR-- adminSimpleMenuBeforeEdit
|
||||
# Should modify if necessary $item_label, $item_descr and $item_url
|
||||
# Should set if necessary $item_select_label (displayed on further admin step only)
|
||||
$core->callBehavior('adminSimpleMenuBeforeEdit', $item_type, $item_select,
|
||||
[ & $item_label, &$item_descr, &$item_url, &$item_select_label]);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
// Fourth step, menu item to be added
|
||||
try {
|
||||
if (($item_label != '') && ($item_url != '')) {
|
||||
// Add new item menu in menu array
|
||||
$menu[] = [
|
||||
'label' => $item_label,
|
||||
'descr' => $item_descr,
|
||||
'url' => $item_url,
|
||||
'targetBlank' => $item_targetBlank
|
||||
];
|
||||
|
||||
// Save menu in blog settings
|
||||
$core->blog->settings->system->put('simpleMenu', $menu);
|
||||
$core->blog->triggerBlog();
|
||||
|
||||
// All done successfully, return to menu items list
|
||||
dcPage::addSuccessNotice(__('Menu item has been successfully added.'));
|
||||
http::redirect($p_url);
|
||||
} else {
|
||||
$step = 3;
|
||||
$item_select_label = $item_label;
|
||||
dcPage::addErrorNotice(__('Label and URL of menu item are mandatory.'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
# Remove selected menu items
|
||||
if (!empty($_POST['removeaction'])) {
|
||||
try {
|
||||
if (!empty($_POST['items_selected'])) {
|
||||
foreach ($_POST['items_selected'] as $k => $v) {
|
||||
$menu[$v]['label'] = '';
|
||||
}
|
||||
$newmenu = [];
|
||||
foreach ($menu as $k => $v) {
|
||||
if ($v['label']) {
|
||||
$newmenu[] = [
|
||||
'label' => $v['label'],
|
||||
'descr' => $v['descr'],
|
||||
'url' => $v['url'],
|
||||
'targetBlank' => $v['targetBlank']
|
||||
];
|
||||
}
|
||||
}
|
||||
$menu = $newmenu;
|
||||
// Save menu in blog settings
|
||||
$core->blog->settings->system->put('simpleMenu', $menu);
|
||||
$core->blog->triggerBlog();
|
||||
|
||||
// All done successfully, return to menu items list
|
||||
dcPage::addSuccessNotice(__('Menu items have been successfully removed.'));
|
||||
http::redirect($p_url);
|
||||
} else {
|
||||
throw new Exception(__('No menu items selected.'));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
# Update menu items
|
||||
if (!empty($_POST['updateaction'])) {
|
||||
try {
|
||||
foreach ($_POST['items_label'] as $k => $v) {
|
||||
if (!$v) {
|
||||
throw new Exception(__('Label is mandatory.'));
|
||||
}
|
||||
|
||||
}
|
||||
foreach ($_POST['items_url'] as $k => $v) {
|
||||
if (!$v) {
|
||||
throw new Exception(__('URL is mandatory.'));
|
||||
}
|
||||
|
||||
}
|
||||
$newmenu = [];
|
||||
for ($i = 0; $i < count($_POST['items_label']); $i++) {
|
||||
$newmenu[] = [
|
||||
'label' => $_POST['items_label'][$i],
|
||||
'descr' => $_POST['items_descr'][$i],
|
||||
'url' => $_POST['items_url'][$i],
|
||||
'targetBlank' => (empty($_POST['items_targetBlank' . $i])) ? false : true
|
||||
];
|
||||
}
|
||||
$menu = $newmenu;
|
||||
|
||||
$core->auth->user_prefs->addWorkspace('accessibility');
|
||||
if ($core->auth->user_prefs->accessibility->nodragdrop) {
|
||||
# Order menu items
|
||||
$order = [];
|
||||
if (empty($_POST['im_order']) && !empty($_POST['order'])) {
|
||||
$order = $_POST['order'];
|
||||
asort($order);
|
||||
$order = array_keys($order);
|
||||
} elseif (!empty($_POST['im_order'])) {
|
||||
$order = $_POST['im_order'];
|
||||
if (substr($order, -1) == ',') {
|
||||
$order = substr($order, 0, strlen($order) - 1);
|
||||
}
|
||||
$order = explode(',', $order);
|
||||
}
|
||||
if (!empty($order)) {
|
||||
$newmenu = [];
|
||||
foreach ($order as $i => $k) {
|
||||
$newmenu[] = [
|
||||
'label' => $menu[$k]['label'],
|
||||
'descr' => $menu[$k]['descr'],
|
||||
'url' => $menu[$k]['url']];
|
||||
}
|
||||
$menu = $newmenu;
|
||||
}
|
||||
}
|
||||
|
||||
// Save menu in blog settings
|
||||
$core->blog->settings->system->put('simpleMenu', $menu);
|
||||
$core->blog->triggerBlog();
|
||||
|
||||
// All done successfully, return to menu items list
|
||||
dcPage::addSuccessNotice(__('Menu items have been successfully updated.'));
|
||||
http::redirect($p_url);
|
||||
} catch (Exception $e) {
|
||||
$core->error->add($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Display
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $page_title; ?></title>
|
||||
<?php
|
||||
$core->auth->user_prefs->addWorkspace('accessibility');
|
||||
if (!$core->auth->user_prefs->accessibility->nodragdrop) {
|
||||
echo
|
||||
dcPage::jsLoad('js/jquery/jquery-ui.custom.js') .
|
||||
dcPage::jsLoad('js/jquery/jquery.ui.touch-punch.js') .
|
||||
dcPage::jsLoad(dcPage::getPF('simpleMenu/js/simplemenu.js'));
|
||||
}
|
||||
echo dcPage::jsConfirmClose('settings', 'menuitemsappend', 'additem', 'menuitems');
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if ($step) {
|
||||
switch ($step) {
|
||||
case 1:
|
||||
$step_label = __('Step #1');
|
||||
break;
|
||||
case 2:
|
||||
if ($items[$item_type][1]) {
|
||||
$step_label = __('Step #2');
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
if ($items[$item_type][1]) {
|
||||
$step_label = __('Step #3');
|
||||
} else {
|
||||
$step_label = __('Step #2');
|
||||
}
|
||||
break;
|
||||
}
|
||||
echo dcPage::breadcrumb(
|
||||
[
|
||||
html::escapeHTML($core->blog->name) => '',
|
||||
$page_title => $p_url,
|
||||
__('Add item') => '',
|
||||
$step_label => ''
|
||||
],
|
||||
[
|
||||
'hl_pos' => -2]
|
||||
) .
|
||||
dcPage::notices();
|
||||
} else {
|
||||
echo dcPage::breadcrumb(
|
||||
[
|
||||
html::escapeHTML($core->blog->name) => '',
|
||||
$page_title => ''
|
||||
]) .
|
||||
dcPage::notices();
|
||||
}
|
||||
|
||||
if ($step) {
|
||||
// Formulaire d'ajout d'un item
|
||||
switch ($step) {
|
||||
case 1:
|
||||
// Selection du type d'item
|
||||
echo '<form id="additem" action="' . $p_url . '&add=2" method="post">';
|
||||
echo '<fieldset><legend>' . __('Select type') . '</legend>';
|
||||
echo '<p class="field"><label for="item_type" class="classic">' . __('Type of item menu:') . '</label>' . form::combo('item_type', $items_combo) . '</p>';
|
||||
echo '<p>' . $core->formNonce() . '<input type="submit" name="appendaction" value="' . __('Continue...') . '" />' . '</p>';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
break;
|
||||
case 2:
|
||||
if ($items[$item_type][1]) {
|
||||
// Choix à faire
|
||||
echo '<form id="additem" action="' . $p_url . '&add=3" method="post">';
|
||||
echo '<fieldset><legend>' . $item_type_label . '</legend>';
|
||||
switch ($item_type) {
|
||||
case 'lang':
|
||||
echo '<p class="field"><label for="item_select" class="classic">' . __('Select language:') . '</label>' .
|
||||
form::combo('item_select', $langs_combo);
|
||||
break;
|
||||
case 'category':
|
||||
echo '<p class="field"><label for="item_select" class="classic">' . __('Select category:') . '</label>' .
|
||||
form::combo('item_select', $categories_combo);
|
||||
break;
|
||||
case 'archive':
|
||||
echo '<p class="field"><label for="item_select" class="classic">' . __('Select month (if necessary):') . '</label>' .
|
||||
form::combo('item_select', $months_combo);
|
||||
break;
|
||||
case 'pages':
|
||||
echo '<p class="field"><label for="item_select" class="classic">' . __('Select page:') . '</label>' .
|
||||
form::combo('item_select', $pages_combo);
|
||||
break;
|
||||
case 'tags':
|
||||
echo '<p class="field"><label for="item_select" class="classic">' . __('Select tag (if necessary):') . '</label>' .
|
||||
form::combo('item_select', $tags_combo);
|
||||
break;
|
||||
default:
|
||||
echo
|
||||
# --BEHAVIOR-- adminSimpleMenuSelect
|
||||
# Optional step once $item_type known : should provide a field using 'item_select' as id
|
||||
$core->callBehavior('adminSimpleMenuSelect', $item_type, 'item_select');
|
||||
}
|
||||
echo form::hidden('item_type', $item_type);
|
||||
echo '<p>' . $core->formNonce() . '<input type="submit" name="appendaction" value="' . __('Continue...') . '" /></p>';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
// Libellé et description
|
||||
echo '<form id="additem" action="' . $p_url . '&add=4" method="post">';
|
||||
echo '<fieldset><legend>' . $item_type_label . ($item_select_label != '' ? ' (' . $item_select_label . ')' : '') . '</legend>';
|
||||
echo '<p class="field"><label for="item_label" class="classic required"><abbr title="' . __('Required field') . '">*</abbr> ' .
|
||||
__('Label of item menu:') . '</label>' .
|
||||
form::field('item_label', 20, 255, [
|
||||
'default' => $item_label,
|
||||
'extra_html' => 'required placeholder="' . __('Label') . '" lang="' . $core->auth->getInfo('user_lang') . '" spellcheck="true"'
|
||||
]) .
|
||||
'</p>';
|
||||
echo '<p class="field"><label for="item_descr" class="classic">' .
|
||||
__('Description of item menu:') . '</label>' . form::field('item_descr', 30, 255,
|
||||
[
|
||||
'default' => $item_descr,
|
||||
'extra_html' => 'lang="' . $core->auth->getInfo('user_lang') . '" spellcheck="true"'
|
||||
]) . '</p>';
|
||||
echo '<p class="field"><label for="item_url" class="classic required"><abbr title="' . __('Required field') . '">*</abbr> ' .
|
||||
__('URL of item menu:') . '</label>' .
|
||||
form::field('item_url', 40, 255, [
|
||||
'default' => $item_url,
|
||||
'extra_html' => 'required placeholder="' . __('URL') . '"'
|
||||
]) .
|
||||
'</p>';
|
||||
echo form::hidden('item_type', $item_type) . form::hidden('item_select', $item_select);
|
||||
echo '<p class="field"><label for="item_descr" class="classic">' .
|
||||
__('Open URL on a new tab') . ':</label>' . form::checkbox('item_targetBlank', 'blank') . '</p>';
|
||||
echo '<p>' . $core->formNonce() . '<input type="submit" name="appendaction" value="' . __('Add this item') . '" /></p>';
|
||||
echo '</fieldset>';
|
||||
echo '</form>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Formulaire d'activation
|
||||
if (!$step) {
|
||||
echo '<form id="settings" action="' . $p_url . '" method="post">' .
|
||||
'<p>' . form::checkbox('active', 1, $menu_active) .
|
||||
'<label class="classic" for="active">' . __('Enable simple menu for this blog') . '</label>' . '</p>' .
|
||||
'<p>' . $core->formNonce() . '<input type="submit" name="saveconfig" value="' . __('Save configuration') . '" />' . '</p>' .
|
||||
'</form>';
|
||||
}
|
||||
|
||||
// Liste des items
|
||||
if (!$step) {
|
||||
echo '<form id="menuitemsappend" action="' . $p_url . '&add=1" method="post">';
|
||||
echo '<p class="top-add">' . $core->formNonce() . '<input class="button add" type="submit" name="appendaction" value="' . __('Add an item') . '" /></p>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
if (count($menu)) {
|
||||
if (!$step) {
|
||||
echo '<form id="menuitems" action="' . $p_url . '" method="post">';
|
||||
}
|
||||
// Entête table
|
||||
echo
|
||||
'<div class="table-outer">' .
|
||||
'<table class="dragable">' .
|
||||
'<caption>' . __('Menu items list') . '</caption>' .
|
||||
'<thead>' .
|
||||
'<tr>';
|
||||
if (!$step) {
|
||||
echo '<th scope="col"></th>';
|
||||
echo '<th scope="col"></th>';
|
||||
}
|
||||
echo
|
||||
'<th scope="col">' . __('Label') . '</th>' .
|
||||
'<th scope="col">' . __('Description') . '</th>' .
|
||||
'<th scope="col">' . __('URL') . '</th>' .
|
||||
'<th scope="col">' . __('Open URL on a new tab') . '</th>' .
|
||||
'</tr>' .
|
||||
'</thead>' .
|
||||
'<tbody' . (!$step ? ' id="menuitemslist"' : '') . '>';
|
||||
$count = 0;
|
||||
foreach ($menu as $i => $m) {
|
||||
echo '<tr class="line" id="l_' . $i . '">';
|
||||
|
||||
//because targetBlank can not exists. This value has been added after this plugin creation.
|
||||
if ((isset($m['targetBlank'])) && ($m['targetBlank'])) {
|
||||
$targetBlank = true;
|
||||
$targetBlankStr = 'X';
|
||||
} else {
|
||||
$targetBlank = false;
|
||||
$targetBlankStr = '';
|
||||
}
|
||||
|
||||
if (!$step) {
|
||||
$count++;
|
||||
echo '<td class="handle minimal">' .
|
||||
form::number(['order[' . $i . ']'], [
|
||||
'min' => 1,
|
||||
'max' => count($menu),
|
||||
'default' => $count,
|
||||
'class' => 'position',
|
||||
'extra_html' => 'title="' . sprintf(__('position of %s'), html::escapeHTML(__($m['label']))) . '"'
|
||||
]) .
|
||||
form::hidden(['dynorder[]', 'dynorder-' . $i], $i) . '</td>';
|
||||
echo '<td class="minimal">' . form::checkbox(['items_selected[]', 'ims-' . $i], $i) . '</td>';
|
||||
echo '<td class="nowrap" scope="row">' . form::field(['items_label[]', 'iml-' . $i], '', 255,
|
||||
[
|
||||
'default' => html::escapeHTML(__($m['label'])),
|
||||
'extra_html' => 'lang="' . $core->auth->getInfo('user_lang') . '" spellcheck="true"'
|
||||
]) . '</td>';
|
||||
echo '<td class="nowrap">' . form::field(['items_descr[]', 'imd-' . $i], '30', 255,
|
||||
[
|
||||
'default' => html::escapeHTML(__($m['descr'])),
|
||||
'extra_html' => 'lang="' . $core->auth->getInfo('user_lang') . '" spellcheck="true"'
|
||||
]) . '</td>';
|
||||
echo '<td class="nowrap">' . form::field(['items_url[]', 'imu-' . $i], '30', 255, html::escapeHTML($m['url'])) . '</td>';
|
||||
echo '<td class="nowrap">' . form::checkbox('items_targetBlank' . $i, 'blank', $targetBlank) . '</td>';
|
||||
} else {
|
||||
echo '<td class="nowrap" scope="row">' . html::escapeHTML(__($m['label'])) . '</td>';
|
||||
echo '<td class="nowrap">' . html::escapeHTML(__($m['descr'])) . '</td>';
|
||||
echo '<td class="nowrap">' . html::escapeHTML($m['url']) . '</td>';
|
||||
echo '<td class="nowrap">' . $targetBlankStr . '</td>';
|
||||
|
||||
}
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody>' .
|
||||
'</table></div>';
|
||||
if (!$step) {
|
||||
echo '<div class="two-cols">';
|
||||
echo '<p class="col">' . form::hidden('im_order', '') . $core->formNonce();
|
||||
echo '<input type="submit" name="updateaction" value="' . __('Update menu') . '" />' . '</p>';
|
||||
echo '<p class="col right">' . '<input id="remove-action" type="submit" class="delete" name="removeaction" ' .
|
||||
'value="' . __('Delete selected menu items') . '" ' .
|
||||
'onclick="return window.confirm(\'' . html::escapeJS(__('Are you sure you want to remove selected menu items?')) . '\');" />' .
|
||||
'</p>';
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
} else {
|
||||
echo
|
||||
'<p>' . __('No menu items so far.') . '</p>';
|
||||
}
|
||||
|
||||
dcPage::helpBlock('simpleMenu');
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
1
dotclear._no/plugins/simpleMenu/js/simplemenu.js
Normal file
1
dotclear._no/plugins/simpleMenu/js/simplemenu.js
Normal file
@ -0,0 +1 @@
|
||||
'use strict';$(function(){$('#menuitemslist').sortable({'cursor':'move'});$('#menuitemslist tr').on('mouseenter',function(){$(this).css({'cursor':'move'});}).on('mouseleave',function(){$(this).css({'cursor':'auto'});});$('#menuitems').on('submit',function(){let order=[];$('#menuitemslist tr td input.position').each(function(){order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1'));});$('input[name=im_order]')[0].value=order.join(',');return true;});$('#menuitemslist tr td input.position').hide();$('#menuitemslist tr td.handle').addClass('handler');dotclear.condSubmit('#menuitems tr td input[name^=items_selected]','#menuitems #remove-action');dotclear.responsiveCellHeaders(document.querySelector('#menuitems table'),'#menuitems table',2);});
|
||||
42
dotclear._no/plugins/simpleMenu/locales/en/help/help.html
Normal file
42
dotclear._no/plugins/simpleMenu/locales/en/help/help.html
Normal file
@ -0,0 +1,42 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Simple menu</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h4>Simple menu</h4>
|
||||
<p>Simple menu allows you to display a single level menu on your blog if
|
||||
your theme supports it.</p>
|
||||
<dl>
|
||||
<dt>Menu items list</dt>
|
||||
<dd>Here are displayed your menu items.<br />
|
||||
You can reorder this list by dragging its items up and down.<br />
|
||||
You can also modify the label, description and URL of each item.<br />
|
||||
Once done, click on <strong>Update menu</strong>.</dd>
|
||||
|
||||
<dt>Delete selected menu items</dt>
|
||||
<dd>Allows you to delete menu items by checking the boxes next to each of them.</dd>
|
||||
|
||||
<dt>Add a new menu item</dt>
|
||||
<dd>First select the type of item. Then click on <strong>Continue…</strong>. Then, if
|
||||
necessary, you may have to define a sub-type (category, page, etc.). If so,
|
||||
do it and click on <strong>Continue…</strong>. Then finally you can modify proposals done for
|
||||
label, description (not mandatory) and URL of the menu item.
|
||||
Once done, click on <strong>Add this item</strong>.</dd>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><strong>Label:</strong> The anchor text. For example
|
||||
"Archives". This field is mandatory.</li>
|
||||
<li><strong>Description:</strong> A short description for the menu
|
||||
item (will be displayed under the label depending on the selected theme). For example:
|
||||
"Archives from 2004 to 2011".</li>
|
||||
<li><strong>URL:</strong> The item URL. This field is
|
||||
mandatory.</li>
|
||||
<li><strong>Open URL on a new tab:</strong> Check if this link should be opened in a new tab or a new window.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
||||
12
dotclear._no/plugins/simpleMenu/locales/en/resources.php
Normal file
12
dotclear._no/plugins/simpleMenu/locales/en/resources.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!isset($__resources['help']['simpleMenu'])) {
|
||||
$__resources['help']['simpleMenu'] = dirname(__FILE__) . '/help/help.html';
|
||||
}
|
||||
45
dotclear._no/plugins/simpleMenu/locales/fr/help/help.html
Normal file
45
dotclear._no/plugins/simpleMenu/locales/fr/help/help.html
Normal file
@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Menu simple</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h4>Menu simple</h4>
|
||||
<p>Menu simple vous permet d’afficher un menu limité à un seul niveau sur votre
|
||||
blog, si votre thème le supporte.</p>
|
||||
<dl>
|
||||
<dt>Liste des items de menu</dt>
|
||||
<dd>Ici sont affichés les items de votre menu.
|
||||
Vous pouvez les ordonner en déplaçant les lignes vers le haut ou vers le bas.<br />
|
||||
Vous pouvez également modifier le libellé, la description et l’URL de chacun
|
||||
des items.<br />
|
||||
Une fois terminé, cliquez sur « Mettre à jour le menu ».</dd>
|
||||
|
||||
<dt>Supprimer les items de menu sélectionnés</dt>
|
||||
<dd>Vous permet de supprimer les items de menu que vous souhaitez en cochant
|
||||
les cases pour chacun d’eux.</dd>
|
||||
|
||||
<dt>Ajouter un item de menu</dt>
|
||||
<dd>Tout d’abord sélectionnez le type d’item que vous désirez, puis cliquez
|
||||
sur « Continuer… ». Ensuite, si nécessaire, vous pouvez avoir à précisez votre
|
||||
choix (catégorie, page, etc). Dans ce cas, faites-le et cliquez sur
|
||||
« Continuer… ». Enfin vous pouvez modifier les propositions qui vous sont
|
||||
faites pour le libellé, la description (facultative) et l’URL de l’item de menu.
|
||||
Une fois effectué cliquer sur « Ajouter cet item ».</dd>
|
||||
<dd>
|
||||
<ul>
|
||||
<li><strong>Libelllé :</strong> indiquez ici le libellé. Par exemple
|
||||
"Archives". Ce champs est obligatoire.</li>
|
||||
<li><strong>Description :</strong> indiquez ici une courte description
|
||||
pour cet item (sera affiché sous le libellé en fonction du thème sélectionné).
|
||||
Par exemple "Archives de 2004 à 2011".</li>
|
||||
<li><strong>URL :</strong> indiquez ici la destination. Ce champ est
|
||||
obligatoire.</li>
|
||||
<li><strong>S'ouvre dans un nouvel onglet :</strong> Cochez si le lien doit s'ouvrir dans un nouvel onglet ou une nouvelle fenêtre.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
||||
</dl>
|
||||
</body>
|
||||
</html>
|
||||
12
dotclear._no/plugins/simpleMenu/locales/fr/resources.php
Normal file
12
dotclear._no/plugins/simpleMenu/locales/fr/resources.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Dotclear
|
||||
* @subpackage Plugins
|
||||
*
|
||||
* @copyright Olivier Meunier & Association Dotclear
|
||||
* @copyright GPL-2.0-only
|
||||
*/
|
||||
|
||||
if (!isset($__resources['help']['simpleMenu'])) {
|
||||
$__resources['help']['simpleMenu'] = dirname(__FILE__) . '/help/help.html';
|
||||
}
|
||||
2
dotclear._no/plugins/simpleMenu/simplemenu.js
Executable file
2
dotclear._no/plugins/simpleMenu/simplemenu.js
Executable file
@ -0,0 +1,2 @@
|
||||
|
||||
$(function(){$("#menuitemslist").sortable({'cursor':'move'});$("#menuitemslist tr").hover(function(){$(this).css({'cursor':'move'});},function(){$(this).css({'cursor':'auto'});});$('#menuitems').submit(function(){var order=[];$("#menuitemslist tr td input.position").each(function(){order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1'));});$("input[name=im_order]")[0].value=order.join(',');return true;});$("#menuitemslist tr td input.position").hide();$("#menuitemslist tr td.handle").addClass('handler');dotclear.condSubmit('#menuitems tr td input[type="checkbox"]','#menuitems #remove-action');});
|
||||
Reference in New Issue
Block a user