個人的改造メモ

デフォからオリジナルを弄った部分のメモ書き。

conf/lang/ja/edit.txt

Ricewind RC1以降で inc/lang/ja/edit.txt からコピーして変更。

-編集して''保存''をクリックしてください。Wikiの構文については [[wiki:syntax]] を参考にしてください
+編集して''保存''をクリックしてください。Wikiの構文については [[doku>ja:syntax]] を参考にしてください

lib/images/

  • lib/images/fileicons/zip.png を download.png に変更。

lib/tpl/arctic/

  • lib/tpl/arctic/images/favicon.ico を書き換え。
  • lib/tpl/arctic/footer.html にアクセスカウンター呼出しコードを追加。
  • lib/tpl/arctic/main.php にmy-sv.net用バーナー位置設定と最上部のカレントページ名を非表示。
    lib/tpl/arctic/main.php
           <div class="header">
    -        <div class="pagename">
    -          [[<?php tpl_link(wl($ID,'do=backlink'),tpl_pagetitle($ID,true))?>]]
    -        </div>
             <div class="logo">
               <?php tpl_link(wl(),$conf['title'],'name="dokuwiki__top" accesskey="h" title="[ALT+H]"')?>
             </div>
    +        <!-- add my-sv banner -->
    +        <!--nobanner-->
    +        <div style="float: right;">
    +          <!--mysv_banner-->
    +        </div>
    +        <!-- add my-sv banner end -->
           </div>
  • lib/tpl/arctic/sidebars/cloud/sidebar.php 追加。
    元ネタ:template:arctic#cloud_plugin まんま
    lib/tpl/arctic/sidebars/cloud/sidebar.php
    <?php
    print p_render('xhtml',p_get_instructions('~~TAGCLOUD~~'),$info);
    ?>
  • lib/tpl/arctic/sidebars/sitetoc/sidebar.php 追加。
    元ネタ:template:arctic#site_toc を改造
    namespace:page:startは非表示。namespace:pageはnamespace:page:startから表示名を取得する。
    lib/tpl/arctic/sidebars/sitetoc/sidebar.php
    <?php
    /**
     * Table of content-function that will 
     * create a hierarchical TOC for the site (by namespace)
     * and highlight the current page
     * The startpage if it exists, will always
     * be shown first in the menu
     */
     
    function tpl_processStartPage($ns,$context) {
      // Check if a start page exists and add it first
      global $conf;
    	$pageExists = false;
      $startPageName = $conf['start'];
      if ($ns == "") {
        $startPageID = $startPageName;
      } else {
        $startPageID =  $ns . ":" . $startPageName;
      }
     
    	$startPagePath = $startPageID;
     
    	resolve_pageid($ns, $startPagePath,$pageExists);
     
    	if ($pageExists) {
    		// Check if page is visible
     
        $perm = auth_quickaclcheck($startPageID);
    if ($ns) $perm = -1; // namespace:startは表示させない(ルートのstartは表示)
      	if($perm > 0){
     
      		// Determine Page Title from first heading
      		$firstHeading = p_get_first_heading($startPageID);
     
      		if($conf['useheading'] && !empty($firstHeading)){
      			$linkName = $firstHeading;
     
      		}else{
      			$linkName = $startPageName;
      		}
      		// echo "<b>" . $conf['useheading'] ."</b>";
      	  tpl_pageLinkCreate($startPageID, $linkName, "tpl_processStartPage:$context");
      	}
     
      }
    }
     
    function tpl_pageLinkCreate($fileToLinkID, $linkName, $calledFrom) {
        global $ID;
    		echo "<li class=\"file\">";
     
    		if($fileToLinkID == $ID){
    			// highlight current page
    			echo "<strong class=\"currentPage\">";
    		}
    		if($_REQUEST["do"] == "admin" && $_REQUEST["page"] == "acl"){
    			$path = wl($fileToLinkID, "do=admin&amp;page=acl");
    		}else{
    			$path = wl($fileToLinkID);
    		}
        // echo "<em>$fileToLinkID, $linkName, $calledFrom</em>";
        tpl_link($path,$linkName);
     
    		if($fileToLinkID == $ID){
    			// current page
    			echo "</strong>";
    		}
    }
     
    function tpl_list_folder($dataList, $findAndProcessStartpage){
    	global $conf;
    	global $ID;
    	global $INFO;
     
    	require_once(DOKU_INC.'inc/auth.php');
     
    	$currentLevel = 1;
     
    	$pathinfo = pathinfo($_SERVER['REQUEST_URI']);
    	$url = $pathinfo['dirname'];
     
    	echo "<ul class=\"explorer\">\n";
     
      tpl_processStartPage("","tof");
     
    	for($i=0; $i<count($dataList); $i++){		
     
    		// Check if page is visible
    		if($dataList[$i]["type"] == "d"){
    			$perm = auth_quickaclcheck($dataList[$i]["id"].":*");
    		}else{
    			$perm = auth_quickaclcheck($dataList[$i]["id"]);
    	//$perm = -1;//ファイルを表示させないならコメントを外す
    		}
    		// process only visible pages
    		if($perm > 0){
     
          // don't show start page in normal order
    			if (noNS($dataList[$i]["id"]) != $conf['start']) {
     
             // FIXME not sure if this is actually needed
             // Could we not use  noNS($dataList[$i]["id"]) instead???
             $pageFileName = explode(":", $dataList[$i]["id"]);
             $pageFileName = $pageFileName[count($pageFileName) - 1];
             $pageFileName = str_replace("_", " ", $pageFileName);
     
        			// Determine Page Title from first heading
        		//  ディレクトリの表示名はnamespace:page:startから取得させる
        		$linkid = $dataList[$i]["id"];
        		if($dataList[$i]["type"] == "d") $linkid .= ':'. $conf['start'];
        		$firstHeading = p_get_first_heading($linkid);
        		if($conf['useheading'] && !empty($firstHeading)){
        				$linkName = $firstHeading;
        			}else{
        				$linkName = $pageFileName;
        			}
     
        			// Adjust the level. If level of page is higher than current level
        			// close list-item and list
        			// FIXME: Why is this needed when the same happens down below?
        			if($currentLevel > $dataList[$i]["level"]){
        				echo str_repeat("</ul></li>\n", $currentLevel - $dataList[$i]["level"]);
        				$currentLevel = $dataList[$i]["level"];
        			}
     
              // if entry is a folder
        			if($dataList[$i]["type"] == "d"){
     
        				if($dataList[$i]["open"]){
        					echo "<li class=\"open\">";
        				}else{
        					echo "<li class=\"closed\">";
        				}
     
        				if($_REQUEST["do"] == "admin" && $_REQUEST["page"] == "acl"){
        					$path = wl($dataList[$i]["id"].":".$conf['start'], "do=admin&amp;page=acl");
        				}else{
        					$path = wl($dataList[$i]["id"].":".$conf['start']);
        				}
        		// 現在位置がnamespace:page:startならnamespace:pageを強調表示
        		$dirstrong = false;
        		if ($ID == $dataList[$i]["id"].":".$conf['start']) $dirstrong = true;
                if ($dirstrong) echo "<strong class=\"currentPage\">";
        				tpl_link($path,$linkName);
        		if ($dirstrong) echo "</strong>";
        			}else{
        				// entry is a file
                // echo "<p>Path: $path, LinkName: $linkName, id: ". $dataList[$i]["id"] . "</p>";
        				tpl_pageLinkCreate ($dataList[$i]["id"], $linkName, "direkt:tpl_list_folder" );
        			}
     
        			if($dataList[$i+1]["level"] == $currentLevel){
        				// current folder (just close list-item)
        				echo "</li>\n";
        			}else if($dataList[$i+1]["level"] > $currentLevel){
        				// new sub-folder (start new sub-list)
        				echo "<ul class=\"idx\">\n";
        				// Check if a start page exists and add it first
     
                tpl_processStartPage($dataList[$i]["id"],"");
        			}else if($dataList[$i+1]["level"] < $currentLevel){
        				// end of sub-folder (close open sublists)
        				if(!empty($dataList[$i+1]["level"])){
        					echo str_repeat("</ul></li>\n", $currentLevel - $dataList[$i+1]["level"]);
        				}
        			}
        			$currentLevel = $dataList[$i+1]["level"];
    			}
    		}
    	}
    	echo "</ul>\n";
    }
     
    	// 見出し追加
    	print '<h1 class="sidebar-title">現在位置</h1>';
      global $ID;
    	global $ACT;
    	global $conf;
     
     
    	$folder = getNS($ID);
     
    	require_once(DOKU_INC.'inc/search.php');
    	require_once(DOKU_INC.'inc/html.php');
     
    	$ns  = cleanID($ID);	
    	if(empty($ns)){
    		$ns = dirname(str_replace(':','/',$ID));
    		if($ns == '.') $ns ='';
    	}
    	$ns  = utf8_encodeFN(str_replace(':','/',$ns));
     
    	$list = array();
    	search($list,$conf['datadir'],'search_index',array('ns' => $ns));
     
    	tpl_list_folder($list,true);
     
     
    ?>
  • lib/tpl/arctic/sidebars/recent/sidebar.php
    lib/tpl/arctic/sidebars/recent/sidebar.php
    <?php
    print '<h1 class="sidebar-title">最新の5件</h1>';
    print p_render('xhtml',p_get_instructions('{{changes>5&render = pagelist(list,nodate)}}'),$info);
    ?>
dokuwiki/custom.txt · 最終更新: 2017/03/23 21:19 by pokan
CC Attribution-Noncommercial-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0