-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default Picture option is added. Usage: -defaultPicture="Image URL"
- Loading branch information
Showing
7 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
$conf['toolbar_inserted_markup'] = '<nspages -h1 -subns -exclude:start>'; | ||
$conf['cache'] = 1; | ||
$conf['default_picture'] = ''; | ||
$conf['cache'] = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
$meta['toolbar_inserted_markup'] = array('string'); | ||
$meta["cache"] = array("onoff"); | ||
$meta['default_picture'] = array('string'); | ||
$meta["cache"] = array("onoff"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
$lang['cache'] = 'Disable the cache'; | ||
$lang['default_picture'] = 'Set your default picture'; | ||
$lang['toolbar_inserted_markup'] = 'Toolbar inserted markup'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html) | ||
* | ||
* @author Sam01 <[email protected]> | ||
* @author Ghassem Tofighi <[email protected]> | ||
*/ | ||
$lang['cache'] = 'غیرفعال کردن کش '; | ||
$lang['default_picture'] = 'درج تصویر پیشفرض'; | ||
$lang['toolbar_inserted_markup'] = 'درج نشانهگذار نوار ابزار'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* @author Daniel Schranz <[email protected]> | ||
* @author Ignacio Bergmann | ||
* @author Andreas Gohr <[email protected]> | ||
* @author Ghassem Tofighi <[email protected]> | ||
*/ | ||
if(!defined('DOKU_INC')) die(); | ||
require_once 'printers/printerLineBreak.php'; | ||
|
@@ -78,6 +79,9 @@ function handle($match, $state, $pos, Doku_Handler $handler) { | |
optionParser::checkExclude($match, $return['excludedPages'], $return['excludedNS']); | ||
optionParser::checkAnchorName($match, $return['anchorName']); | ||
optionParser::checkActualTitle($match, $return['actualTitleLevel']); | ||
optionParser::checkDefaultPicture($match, $return['defaultPicture'], $this); | ||
|
||
|
||
|
||
//Now, only the wanted namespace remains in $match | ||
$nsFinder = new namespaceFinder($match); | ||
|
@@ -104,7 +108,7 @@ private function _getDefaultOptions(){ | |
'natOrder' => false, 'sortDate' => false, | ||
'hidenopages' => false, 'hidenosubns' => false, 'usePictures' => false, | ||
'modificationDateOnPictures' => false, | ||
'sortByCreationDate' => false | ||
'sortByCreationDate' => false, 'defaultPicture' => null, | ||
); | ||
} | ||
|
||
|
@@ -115,6 +119,7 @@ function render($mode, Doku_Renderer $renderer, $data) { | |
//behave well with the translation plugin (it seems like we cache strings | ||
//even if the lang doesn't match) | ||
$this->_denullifyLangOptions($data); | ||
$this->_denullifyPictureOptions($data); | ||
$printer = $this->_selectPrinter($mode, $renderer, $data); | ||
|
||
if( ! $this->_isNamespaceUsable($data)){ | ||
|
@@ -132,7 +137,6 @@ function render($mode, Doku_Renderer $renderer, $data) { | |
$printer->printBeginning(); | ||
$this->_print($printer, $data, $subnamespaces, $pages); | ||
$printer->printEnd(); | ||
|
||
return TRUE; | ||
} | ||
|
||
|
@@ -145,6 +149,12 @@ function _denullifyLangOptions(&$data){ | |
$data['textPages'] = $this->getLang('pagesinthiscat'); | ||
} | ||
} | ||
|
||
function _denullifyPictureOptions(&$data){ | ||
if ( is_null($data['defaultPicture']) ){ | ||
$data['defaultPicture'] = $this->getConf('default_picture'); | ||
} | ||
} | ||
|
||
private function _shouldPrintPagesAmongNamespaces($data){ | ||
return $data['pagesinns']; | ||
|