Skip to content

Commit

Permalink
Added a quick way to select images instead of autogenerated icons
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jun 16, 2011
1 parent 4600ef1 commit 7055e26
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 6 deletions.
15 changes: 11 additions & 4 deletions action.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,25 @@ function makelist() {
$conf = $this->loadCBData();
$buttonlist = array();
foreach ($conf as $button) {
$ico = '../../plugins/custombuttons/';
if(!$button['icon']){
$ico .= 'genpng.php?text='.$button["label"];
}else{
$ico .= 'ico/'.$button['icon'];
}

if ($button["type"] == 1) {
$buttonlist[] = array(
'type' => 'format',
'type' => 'format',
'title' => $button["label"],
'icon' => '../../plugins/custombuttons/genpng.php?text='.$button["label"],
'open' => $button["pretag"],
'icon' => $ico,
'open' => $button["pretag"],
'close' => $button["posttag"]);
} else {
$buttonlist[] = array(
'type' => 'insert',
'title' => $button["label"],
'icon' => '../../plugins/custombuttons/genpng.php?text='.$button["label"],
'icon' => $ico,
'insert' => $button["code"],
'block' => true);
}
Expand Down
13 changes: 12 additions & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function handle() {
"code" => $_REQUEST["code"],
"type" => $type,
"pretag" => $_REQUEST["pretag"],
"posttag" => $_REQUEST["posttag"]
"posttag" => $_REQUEST["posttag"],
"icon" => $_REQUEST["icon"],
));
$this->saveCBData($conf);
$this->reloadBar();
Expand Down Expand Up @@ -96,6 +97,16 @@ function html() {
ptln(' <input type="hidden" name="page" value="'.$this->getPluginName().'" />');
formSecurityToken();
ptln(' <table>');
ptln(' <tr><th>Icon:</th><td>');
ptln('<select name="icon">');
ptln('<option value="">text only</option>');
$files = glob(dirname(__FILE__).'/ico/*.png');
foreach($files as $file){
$file = hsc(basename($file));
ptln('<option value="'.$file.'" style="padding-left: 18px; background: #fff url('.DOKU_BASE.'lib/plugins/custombuttons/ico/'.$file.') left center no-repeat">'.$file.'</option>');
}
ptln('</select>');
ptln(' </td></tr>');
ptln(' <tr><th>Label:</th><td><input type="text" name="label" /></td></tr>');
ptln(' <tr><th>Pre tag:</th><td><input type="text" name="pretag" /><b> *</b></td></tr>');
ptln(' <tr><th>Post tag:</th><td><input type="text" name="posttag" /><b> *</b></td></tr>');
Expand Down
Binary file added ico/add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/asterisk_orange.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/attach.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/book_open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/bullet_wrench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/car.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/chart_bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/chart_line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/clock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/comment.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/email.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/page_code.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/page_white_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/pilcrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ico/status_offline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugin.info.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base custombuttons
author Constantinos Xanthopoulos
email conx@xanthopoulos.info
date 2010-07-20
date 2011-06-16
name custombuttons plugin
desc A plugin for adding custom buttons to the toolbar, to shortcut commonly used code blocks.
url http://www.dokuwiki.org/plugin:custombuttons

0 comments on commit 7055e26

Please sign in to comment.