mirror of
https://github.com/e107inc/e107.git
synced 2025-08-16 19:44:09 +02:00
Separated admin/menu.php into a separate class. Added instant menuPreset activation in theme-manager plus other small gui enhances. Added iconpool - work in progress.
Iconpool: installed plugins containing png files in their image folder with a *_16, *_32, *_48 etc name ending will automatically be added to the iconpool. This central pool will be available in all areas of admin where we choose icons. eg. download category, links, event-calendar, links-page etc etc.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: iconpicker.php,v 1.1 2009-01-16 17:57:56 secretr Exp $
|
||||
* $Id: iconpicker.php,v 1.2 2009-07-16 02:55:19 e107coders Exp $
|
||||
*
|
||||
* Image picker shortcode
|
||||
*
|
||||
@@ -41,7 +41,44 @@ function iconpicker_shortcode($parm)
|
||||
$tmp = array(16, 32, 48, 64, 128);
|
||||
$tmp1 = array();
|
||||
$name = varset($parms['id']);
|
||||
foreach($iconlist as $icon)
|
||||
|
||||
global $iconpool,$tp;
|
||||
|
||||
$iconlist = $iconpool;
|
||||
|
||||
foreach($iconlist as $folder)
|
||||
{
|
||||
|
||||
// $filepath = varsettrue($parms['path_omit']) ? str_replace(explode('|', $parms['path_omit']), "", $icon['path'].$icon['fname']) : $e107->tp->createConstants($icon['path'], 1).$icon['fname'];
|
||||
// $filepath_abs = str_replace(array(e_IMAGE, e_FILE, e_PLUGIN), array(e_IMAGE_ABS, e_FILE_ABS, e_PLUGIN_ABS), $icon['path'].$icon['fname']);
|
||||
|
||||
foreach($folder as $icon)
|
||||
{
|
||||
$filepath = $icon;
|
||||
$filepath_abs = $tp->replaceConstants($icon);
|
||||
$icon_file = basename($filepath_abs);
|
||||
|
||||
$str = "<a href='#{$filepath}' title='{$filepath}' onclick=\"e107Helper.insertText('{$filepath}','{$name}','{$name}-iconpicker'); return false; \"><img class='icon picker list%%size%%' src='{$filepath_abs}' alt='{$filepath}' /></a>";
|
||||
|
||||
foreach ($tmp as $isize)
|
||||
{
|
||||
if(strpos($icon_file, '_'.$isize.'.') !== false)
|
||||
{
|
||||
|
||||
$tmp1[$isize] = varset($tmp1[$isize]).str_replace('%%size%%', ' S'.$isize, $str);
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
$tmp1['other'] = varset($tmp1['other']).$str;//other
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*foreach($iconlist as $icon)
|
||||
{
|
||||
|
||||
$filepath = varsettrue($parms['path_omit']) ? str_replace(explode('|', $parms['path_omit']), "", $icon['path'].$icon['fname']) : $e107->tp->createConstants($icon['path'], 1).$icon['fname'];
|
||||
@@ -59,7 +96,7 @@ function iconpicker_shortcode($parm)
|
||||
}
|
||||
}
|
||||
$tmp1['other'] = varset($tmp1['other']).$str;//other
|
||||
}
|
||||
}*/
|
||||
|
||||
return $tmp1 ? '<div id="'.$name.'-iconpicker-ajax"><div class="field-spacer iconpicker">'.str_replace('%%size%%', '', implode('</div><div class="field-spacer iconpicker">', $tmp1)).'</div></div>' : '';
|
||||
|
||||
|
Reference in New Issue
Block a user