はじまりの大地
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\template\bootstrap3\Menu;
|
||||
|
||||
/**
|
||||
* Class DetailMenu
|
||||
*
|
||||
* This menu offers options on an image detail view. It usually displayed similar to
|
||||
* the PageMenu.
|
||||
*/
|
||||
class DetailMenu extends \dokuwiki\Menu\AbstractMenu
|
||||
{
|
||||
protected $view = 'detail';
|
||||
|
||||
protected $types = array(
|
||||
'ImgOriginalSize',
|
||||
'MediaManager',
|
||||
'ImgBackto',
|
||||
'Top',
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class Discussion
|
||||
*/
|
||||
class Discussion extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
|
||||
if (!tpl_getConf('showDiscussion')) {
|
||||
throw new \RuntimeException("discussion is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$discuss_page = str_replace('@ID@', $this->id, tpl_getConf('discussionPage'));
|
||||
$discuss_page_raw = str_replace('@ID@', '', tpl_getConf('discussionPage'));
|
||||
$is_discuss_page = strpos($this->id, $discuss_page_raw) !== false;
|
||||
$back_id = str_replace($discuss_page_raw, '', $this->id);
|
||||
|
||||
if ($is_discuss_page) {
|
||||
$this->label = tpl_getLang('back_to_article');
|
||||
$this->id = cleanID($back_id);
|
||||
$this->svg = tpl_incdir() . 'images/menu/file-document-box-outline.svg';
|
||||
} else {
|
||||
$this->label = tpl_getLang('discussion');
|
||||
$this->id = cleanID($discuss_page);
|
||||
$this->svg = tpl_incdir() . 'images/menu/comment-text-multiple.svg';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class Feed
|
||||
*/
|
||||
class Feed extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
global $lang;
|
||||
|
||||
if (!in_array('feed', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("feed is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = $lang['btn_recent'];
|
||||
$this->svg = tpl_incdir() . 'images/menu/rss.svg';
|
||||
}
|
||||
|
||||
public function getLinkAttributes($classprefix = 'menuitem ')
|
||||
{
|
||||
$attr = parent::getLinkAttributes($classprefix);
|
||||
$attr['href'] = DOKU_URL . 'feed.php?ns=' . getNS($this->id);
|
||||
|
||||
return $attr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class Help
|
||||
*/
|
||||
class Help extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!in_array('help', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("help is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$help_id = page_findnearest('help', tpl_getConf('useACL'));
|
||||
|
||||
if (!$help_id) {
|
||||
throw new \RuntimeException("help page not found");
|
||||
}
|
||||
|
||||
$this->label = hsc(p_get_first_heading($help_id));
|
||||
$this->svg = tpl_incdir() . 'images/menu/help.svg';
|
||||
$this->id = '#';
|
||||
$this->help_id = $help_id;
|
||||
$this->help_link = wl($help_id, array('do' => 'export_xhtmlbody'));
|
||||
}
|
||||
|
||||
public function getLinkAttributes($classprefix = 'menuitem ')
|
||||
{
|
||||
$attr = parent::getLinkAttributes($classprefix);
|
||||
|
||||
$attr['data-toggle'] = 'modal';
|
||||
$attr['data-help-id'] = $this->help_id;
|
||||
$attr['data-target'] = '.modal.help';
|
||||
$attr['data-link'] = $this->help_link;
|
||||
|
||||
return $attr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class ImgOriginalSize
|
||||
*/
|
||||
class ImgOriginalSize extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
global $lang;
|
||||
global $IMG;
|
||||
|
||||
if (!$IMG) {
|
||||
throw new \RuntimeException("image is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = $lang['js']['mediadirect'];
|
||||
$this->svg = tpl_incdir() . 'images/menu/image-size-select-large.svg';
|
||||
$this->id = $IMG;
|
||||
}
|
||||
|
||||
public function getLink()
|
||||
{
|
||||
global $IMG;
|
||||
global $REV;
|
||||
global $INPUT;
|
||||
|
||||
return ml($IMG, array('cache' => $INPUT->str('cache'), 'rev' => $REV), true, '&');
|
||||
}
|
||||
|
||||
public function getLinkAttributes($classprefix = 'menuitem ')
|
||||
{
|
||||
$attr = parent::getLinkAttributes($classprefix);
|
||||
$attr['target'] = '_blank';
|
||||
|
||||
return $attr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class Permalink
|
||||
*/
|
||||
class Permalink extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!in_array('permalink', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("permalink is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = tpl_getLang('permalink');
|
||||
$this->svg = tpl_incdir() . 'images/menu/link.svg';
|
||||
$this->id = '#';
|
||||
}
|
||||
|
||||
public function getLink()
|
||||
{
|
||||
global $ID;
|
||||
global $INFO;
|
||||
|
||||
return DOKU_URL . DOKU_SCRIPT . '?id=' . $ID . '&rev=' . $INFO['lastmod'];
|
||||
}
|
||||
|
||||
public function getLinkAttributes($classprefix = 'menuitem ')
|
||||
{
|
||||
$attr = parent::getLinkAttributes($classprefix);
|
||||
$attr['target'] = '_blank';
|
||||
|
||||
return $attr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class PrintPage
|
||||
*/
|
||||
class PrintPage extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!in_array('print', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("print is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = tpl_getLang('print');
|
||||
$this->svg = tpl_incdir() . 'images/menu/printer.svg';
|
||||
$this->id = '#';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class SendMail
|
||||
*/
|
||||
class SendMail extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!in_array('send-mail', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("send-mail is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = tpl_getLang('send_mail');
|
||||
$this->svg = tpl_incdir() . 'images/menu/email-plus.svg';
|
||||
$this->id = '#';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\Menu\Item;
|
||||
|
||||
/**
|
||||
* Class ShareOn
|
||||
*/
|
||||
class ShareOn extends AbstractItem
|
||||
{
|
||||
|
||||
/** @inheritdoc */
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!in_array('social-share', explode(',', tpl_getConf('pageIcons')))) {
|
||||
throw new \RuntimeException("share on is not available");
|
||||
}
|
||||
|
||||
unset($this->params['do']);
|
||||
|
||||
$this->label = tpl_getLang('share_on');
|
||||
$this->svg = tpl_incdir() . 'images/menu/share-variant.svg';
|
||||
$this->id = '#';
|
||||
}
|
||||
|
||||
public function getLinkAttributes($classprefix = 'menuitem dropdown-toggle ')
|
||||
{
|
||||
global $ID;
|
||||
|
||||
$attr = parent::getLinkAttributes($classprefix);
|
||||
|
||||
$attr['data-toggle'] = 'dropdown';
|
||||
$attr['data-remote'] = wl($ID);
|
||||
$attr['data-target'] = '#';
|
||||
$attr['aria-haspopup'] = 'true';
|
||||
$attr['aria-expanded'] = 'true';
|
||||
|
||||
return $attr;
|
||||
}
|
||||
|
||||
public function getDropDownMenu()
|
||||
{
|
||||
$enabled_providers = explode(',', tpl_getConf('socialShareProviders'));
|
||||
|
||||
$share_providers = array(
|
||||
'twitter' => array('label' => 'Twitter'),
|
||||
'linkedin' => array('label' => 'LinkedIn'),
|
||||
'facebook' => array('label' => 'Facebook'),
|
||||
'pinterest' => array('label' => 'Pinterest'),
|
||||
'telegram' => array('label' => 'Telegram'),
|
||||
'whatsapp' => array('label' => 'WhatsApp'),
|
||||
'yammer' => array('label' => 'Yammer'),
|
||||
'reddit' => array('label' => 'Reddit'),
|
||||
'microsoft-teams' => array('label' => 'Teams'),
|
||||
);
|
||||
|
||||
$html = '';
|
||||
|
||||
$html .= '<ul class="dropdown-menu">';
|
||||
$html .= '<li class="dropdown-header">';
|
||||
$html .= iconify('mdi:share-variant') . ' ' . tpl_getLang('share_on') . '...';
|
||||
$html .= '</li>';
|
||||
|
||||
foreach ($share_providers as $provider => $data) {
|
||||
if (!in_array($provider, $enabled_providers)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$html .= '<li><a href="#" class="share share-' . $provider . '" title="' . tpl_getLang('share_on') . ' ' . $data['label'] . '">' . iconify("mdi:$provider") . ' ' . $data['label'] . '</a></li>';
|
||||
}
|
||||
|
||||
$html .= '</ul>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\template\bootstrap3\Menu;
|
||||
|
||||
/**
|
||||
* Class PageIconsMenu
|
||||
*
|
||||
* Actions manipulating the current page. Shown as a floating menu in the dokuwiki template
|
||||
*/
|
||||
class PageIconsMenu extends \dokuwiki\Menu\AbstractMenu
|
||||
{
|
||||
protected $view = 'pageicons';
|
||||
|
||||
protected $types = array(
|
||||
'ShareOn',
|
||||
'Feed',
|
||||
'SendMail',
|
||||
'PrintPage',
|
||||
'Permalink',
|
||||
'Help',
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace dokuwiki\template\bootstrap3\Menu;
|
||||
|
||||
/**
|
||||
* Class PageMenu
|
||||
*
|
||||
* Actions manipulating the current page. Shown as a floating menu in the dokuwiki template
|
||||
*/
|
||||
class PageMenu extends \dokuwiki\Menu\AbstractMenu
|
||||
{
|
||||
protected $view = 'page';
|
||||
|
||||
protected $types = array(
|
||||
'Edit',
|
||||
'Discussion',
|
||||
'Revert',
|
||||
'Revisions',
|
||||
'Backlink',
|
||||
'Subscribe',
|
||||
'Top',
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user