Warning : Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
MobileMenu.php 0000644 00000005634 15233613103 0007316 0 ustar 00 $pagemenu->getItems(),
'site' => $sitemenu->getItems(),
'user' => $usermenu->getItems()
);
}
/**
* Get all items in a flat array
*
* This returns the same format as AbstractMenu::getItems()
*
* @return AbstractItem[]
*/
public function getItems() {
$menu = $this->getGroupedItems();
return call_user_func_array('array_merge', array_values($menu));
}
/**
* Print a dropdown menu with all DokuWiki actions
*
* Note: this will not use any pretty URLs
*
* @param string $empty empty option label
* @param string $button submit button label
* @return string
*/
public function getDropdown($empty = '', $button = '>') {
global $ID;
global $REV;
/** @var string[] $lang */
global $lang;
global $INPUT;
$html = '';
return $html;
}
}
DetailMenu.php 0000644 00000000524 15233613103 0007302 0 ustar 00 context = $context;
}
/**
* Get the list of action items in this menu
*
* @return AbstractItem[]
* @triggers MENU_ITEMS_ASSEMBLY
*/
public function getItems() {
$data = array(
'view' => $this->view,
'items' => array(),
);
Event::createAndTrigger('MENU_ITEMS_ASSEMBLY', $data, array($this, 'loadItems'));
return $data['items'];
}
/**
* Default action for the MENU_ITEMS_ASSEMBLY event
*
* @see getItems()
* @param array $data The plugin data
*/
public function loadItems(&$data) {
foreach($this->types as $class) {
try {
$class = "\\dokuwiki\\Menu\\Item\\$class";
/** @var AbstractItem $item */
$item = new $class();
if(!$item->visibleInContext($this->context)) continue;
$data['items'][] = $item;
} catch(\RuntimeException $ignored) {
// item not available
}
}
}
/**
* Generate HTML list items for this menu
*
* This is a convenience method for template authors. If you need more fine control over the
* output, use getItems() and build the HTML yourself
*
* @param string|false $classprefix create a class from type with this prefix, false for no class
* @param bool $svg add the SVG link
* @return string
*/
public function getListItems($classprefix = '', $svg = true) {
$html = '';
foreach($this->getItems() as $item) {
if($classprefix !== false) {
$class = ' class="' . $classprefix . $item->getType() . '"';
} else {
$class = '';
}
$html .= "";
$html .= $item->asHtmlLink(false, $svg);
$html .= ' ';
}
return $html;
}
}
Item/Revisions.php 0000644 00000000612 15233613103 0010130 0 ustar 00 accesskey = 'o';
$this->type = 'revs';
$this->svg = DOKU_INC . 'lib/images/menu/07-revisions_history.svg';
}
}
Item/Top.php 0000644 00000001445 15233613103 0006716 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/10-top_arrow-up.svg';
$this->accesskey = 't';
$this->params = array('do' => '');
$this->id = '#dokuwiki__top';
$this->context = self::CTX_DESKTOP;
}
/**
* Convenience method to create a element
*
* Uses html_topbtn()
*
* @todo this does currently not support the SVG icon
* @return string
*/
public function asHtmlButton() {
return html_topbtn();
}
}
Item/Revert.php 0000644 00000001102 15233613103 0007411 0 ustar 00 params['rev'] = $REV;
$this->params['sectok'] = getSecurityToken();
$this->svg = DOKU_INC . 'lib/images/menu/06-revert_replay.svg';
}
}
Item/Media.php 0000644 00000000556 15233613103 0007175 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/folder-multiple-image.svg';
$this->params['ns'] = getNS($ID);
}
}
Item/Resendpwd.php 0000644 00000000734 15233613103 0010107 0 ustar 00 server->str('REMOTE_USER')) {
throw new \RuntimeException("no resendpwd when already logged in");
}
$this->svg = DOKU_INC . 'lib/images/menu/lock-reset.svg';
}
}
Item/Back.php 0000644 00000001232 15233613103 0007006 0 ustar 00 id = $parent;
$this->params = array('do' => '');
$this->accesskey = 'b';
$this->svg = DOKU_INC . 'lib/images/menu/12-back_arrow-left.svg';
}
}
Item/Index.php 0000644 00000001103 15233613103 0007212 0 ustar 00 accesskey = 'x';
$this->svg = DOKU_INC . 'lib/images/menu/file-tree.svg';
// allow searchbots to get to the sitemap from the homepage (when dokuwiki isn't providing a sitemap.xml)
if($conf['start'] == $ID && !$conf['sitemap']) {
$this->nofollow = false;
}
}
}
Item/Profile.php 0000644 00000000727 15233613103 0007556 0 ustar 00 server->str('REMOTE_USER')) {
throw new \RuntimeException("profile is only for logged in users");
}
$this->svg = DOKU_INC . 'lib/images/menu/account-card-details.svg';
}
}
Item/Login.php 0000644 00000001316 15233613103 0007221 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/login.svg';
$this->params['sectok'] = getSecurityToken();
if($INPUT->server->has('REMOTE_USER')) {
if(!actionOK('logout')) {
throw new \RuntimeException("logout disabled");
}
$this->params['do'] = 'logout';
$this->type = 'logout';
$this->svg = DOKU_INC . 'lib/images/menu/logout.svg';
}
}
}
Item/AbstractItem.php 0000644 00000016713 15233613103 0010542 0 ustar 00 id = $ID;
$this->type = $this->getType();
$this->params['do'] = $this->type;
if(!actionOK($this->type)) throw new \RuntimeException("action disabled: {$this->type}");
}
/**
* Return this item's label
*
* When the label property was set, it is simply returned. Otherwise, the action's type
* is used to look up the translation in the main language file and, if used, the replacement
* is applied.
*
* @return string
*/
public function getLabel() {
if($this->label !== '') return $this->label;
/** @var array $lang */
global $lang;
$label = $lang['btn_' . $this->type];
if(strpos($label, '%s')) {
$label = sprintf($label, $this->replacement);
}
if($label === '') $label = '[' . $this->type . ']';
return $label;
}
/**
* Return this item's title
*
* This title should be used to display a tooltip (using the HTML title attribute). If
* a title property was not explicitly set, the label will be returned.
*
* @return string
*/
public function getTitle() {
if($this->title === '') return $this->getLabel();
return $this->title;
}
/**
* Return the link this item links to
*
* Basically runs wl() on $id and $params. However if the ID is a hash it is used directly
* as the link
*
* Please note that the generated URL is *not* XML escaped.
*
* @see wl()
* @return string
*/
public function getLink() {
if($this->id && $this->id[0] == '#') {
return $this->id;
} else {
return wl($this->id, $this->params, false, '&');
}
}
/**
* Convenience method to get the attributes for constructing an element
*
* @see buildAttributes()
* @param string|false $classprefix create a class from type with this prefix, false for no class
* @return array
*/
public function getLinkAttributes($classprefix = 'menuitem ') {
$attr = array(
'href' => $this->getLink(),
'title' => $this->getTitle(),
);
if($this->isNofollow()) $attr['rel'] = 'nofollow';
if($this->getAccesskey()) {
$attr['accesskey'] = $this->getAccesskey();
$attr['title'] .= ' [' . $this->getAccesskey() . ']';
}
if($classprefix !== false) $attr['class'] = $classprefix . $this->getType();
return $attr;
}
/**
* Convenience method to create a full element
*
* Wraps around the label and SVG image
*
* @param string|false $classprefix create a class from type with this prefix, false for no class
* @param bool $svg add SVG icon to the link
* @return string
*/
public function asHtmlLink($classprefix = 'menuitem ', $svg = true) {
$attr = buildAttributes($this->getLinkAttributes($classprefix));
$html = " ";
if($svg) {
$html .= '' . hsc($this->getLabel()) . ' ';
$html .= inlineSVG($this->getSvg());
} else {
$html .= hsc($this->getLabel());
}
$html .= " ";
return $html;
}
/**
* Convenience method to create a element inside it's own form element
*
* Uses html_btn()
*
* @return string
*/
public function asHtmlButton() {
return html_btn(
$this->getType(),
$this->id,
$this->getAccesskey(),
$this->getParams(),
$this->method,
$this->getTitle(),
$this->getLabel(),
$this->getSvg()
);
}
/**
* Should this item be shown in the given context
*
* @param int $ctx the current context
* @return bool
*/
public function visibleInContext($ctx) {
return (bool) ($ctx & $this->context);
}
/**
* @return string the name of this item
*/
public function getType() {
if($this->type === '') {
$this->type = strtolower(substr(strrchr(get_class($this), '\\'), 1));
}
return $this->type;
}
/**
* @return string
*/
public function getAccesskey() {
return $this->accesskey;
}
/**
* @return array
*/
public function getParams() {
return $this->params;
}
/**
* @return bool
*/
public function isNofollow() {
return $this->nofollow;
}
/**
* @return string
*/
public function getSvg() {
return $this->svg;
}
/**
* Return this Item's settings as an array as used in tpl_get_action()
*
* @return array
*/
public function getLegacyData() {
return array(
'accesskey' => $this->accesskey ?: null,
'type' => $this->type,
'id' => $this->id,
'method' => $this->method,
'params' => $this->params,
'nofollow' => $this->nofollow,
'replacement' => $this->replacement
);
}
}
Item/Register.php 0000644 00000000737 15233613103 0007743 0 ustar 00 server->str('REMOTE_USER')) {
throw new \RuntimeException("no register when already logged in");
}
$this->svg = DOKU_INC . 'lib/images/menu/account-plus.svg';
}
}
Item/Admin.php 0000644 00000001006 15233613103 0007175 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/settings.svg';
}
/** @inheritdoc */
public function visibleInContext($ctx)
{
global $INFO;
if(!$INFO['ismanager']) return false;
return parent::visibleInContext($ctx);
}
}
Item/Subscribe.php 0000644 00000000763 15233613103 0010077 0 ustar 00 server->str('REMOTE_USER')) {
throw new \RuntimeException("subscribe is only for logged in users");
}
$this->svg = DOKU_INC . 'lib/images/menu/09-subscribe_email-outline.svg';
}
}
Item/ImgBackto.php 0000644 00000000764 15233613103 0010017 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/12-back_arrow-left.svg';
$this->type = 'img_backto';
$this->params = array();
$this->accesskey = 'b';
$this->replacement = $ID;
}
}
Item/Recent.php 0000644 00000000525 15233613103 0007372 0 ustar 00 accesskey = 'r';
$this->svg = DOKU_INC . 'lib/images/menu/calendar-clock.svg';
}
}
Item/Backlink.php 0000644 00000000511 15233613103 0007663 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/08-backlink_link-variant.svg';
}
}
Item/Edit.php 0000644 00000003426 15233613103 0007042 0 ustar 00 method = 'post';
if($INFO['writable']) {
$this->accesskey = 'e';
if(!empty($INFO['draft'])) {
$this->type = 'draft';
$this->params['do'] = 'draft';
} else {
$this->params['rev'] = $REV;
if(!$INFO['exists']) {
$this->type = 'create';
}
}
} else {
if(!actionOK("source")) throw new \RuntimeException("action disabled: source");
$params['rev'] = $REV;
$this->type = 'source';
$this->accesskey = 'v';
}
} else {
$this->params = array('do' => '');
$this->type = 'show';
$this->accesskey = 'v';
}
$this->setIcon();
}
/**
* change the icon according to what type the edit button has
*/
protected function setIcon() {
$icons = array(
'edit' => '01-edit_pencil.svg',
'create' => '02-create_pencil.svg',
'draft' => '03-draft_android-studio.svg',
'show' => '04-show_file-document.svg',
'source' => '05-source_file-xml.svg',
);
if(isset($icons[$this->type])) {
$this->svg = DOKU_INC . 'lib/images/menu/' . $icons[$this->type];
}
}
}
Item/MediaManager.php 0000644 00000001413 15233613103 0010461 0 ustar 00 svg = DOKU_INC . 'lib/images/menu/11-mediamanager_folder-image.svg';
$this->type = 'mediaManager';
$this->params = array(
'ns' => $imgNS,
'image' => $IMG,
'do' => 'media'
);
}
}
MenuInterface.php 0000644 00000000460 15233613103 0007777 0 ustar 00