Page MenuHomePhabricator

editor.php
No OneTemporary

editor.php

<?php
/**
* DokuWiki Plugin metaeditor (Admin Component)
*
* Simple Meta Data Editor, heavily AJAX/jQuery based.
*
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Andreas Gohr <gohr@cosmocode.de>
*/
// must be run within Dokuwiki
if (!defined('DOKU_INC')) die();
require_once(DOKU_PLUGIN.'admin.php');
class admin_plugin_metaeditor_editor extends DokuWiki_Admin_Plugin {
/**
* Constructor. Load helper plugin
*/
function admin_plugin_metaeditor_editor(){
}
function getMenuSort() { return 501; }
function forAdminOnly() { return true; }
function getMenuText($language) {
return "Simple Meta Data Editor";
}
function handle() {
if(!is_array($_REQUEST['d']) || !checkSecurityToken()) return;
}
function recurseTree($ns) {
global $conf;
$out = '';
$list = array();
$opts = array(
'depth' => 1,
'listfiles' => true,
'listdirs' => true,
'pagesonly' => true,
'firsthead' => true,
'sneakyacl' => $conf['sneaky_index'],
);
search($list,$conf['datadir'],'search_universal',$opts,$ns);
foreach($list as $item)
{
if($item['type'] == 'f' || $item['type'] == 'd')
{
if($item['type'] == 'd')
{
$out .= '<li>'.$item['id'];
$out .= '<ul>'.$this->recurseTree(str_replace(':', '/', $item['id'])).'</ul>';
}
else
{
$out .= '<li data-jstree=\'{"icon":"'.DOKU_URL.'/lib/images/page.png"}\'>'.$item['id'];
}
$out .= '</li>';
}
}
return $out;
}
function html() {
echo '<h1>Meta Data Editor</h1>';
echo '<table>';
echo '<tr><th width="30\%">Page</th><th width="30\%">Meta Data</th><th width="30\%">Value</th></tr>';
echo '<tr>';
echo '<td><div id="fileTree" data-sectok="'.getSecurityToken().'">';
echo '<ul>'.$this->recurseTree('/').'</ul>';
echo '</div></td>';
echo '<td><div id="metaTree"></div></td>';
echo '<td><div id="event_path"></div><br><div id="event_result">';
echo '<input type="text" id="event_value" value="..."><br>';
echo '<input type="submit" id="event_save" value="Save">';
echo '</div></td>';
echo '</tr></table>';
}
}
// vim:ts=4:sw=4:et:enc=utf-8:

File Metadata

Mime Type
text/x-php
Expires
Sat, Dec 21, 7:48 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
917554
Default Alt Text
editor.php (2 KB)

Event Timeline