1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-13 17:12:07 +02:00

Newspost administration - work in progres (news cats ready);

overall administration area improvements;
iconpicker shortcode, iconpicker e_form method;
new Ajax#toggleUpdate, Ajax#scUpdate methods;
old icons removal
This commit is contained in:
secretr 2009-01-16 17:57:57 +00:00
parent 21f4629908
commit 2e951dd633
39 changed files with 282 additions and 152 deletions

View File

@ -9,8 +9,8 @@
* Administration Area - Emotions Settings & Packs
*
* $Source: /cvs_backup/e107_0.8/e107_admin/emoticon.php,v $
* $Revision: 1.12 $
* $Date: 2008-12-18 16:55:45 $
* $Revision: 1.13 $
* $Date: 2009-01-16 17:57:56 $
* $Author: secretr $
*
*/
@ -136,13 +136,13 @@ class emotec
$text = "
<div class='admintabs' id='tab-container'>
<ul class='e-tabs' id='core-emote-tabs'>
<ul class='e-tabs e-hideme' id='core-emote-tabs'>
<li id='tab-activate'><a href='#emoticon-activate'>".EMOLAN_1."</a></li>
<li id='tab-packages'><a href='#emoticon-packages'>".EMOLAN_13."</a></li>
</ul>
<form method='post' action='".e_SELF."'>
<fieldset id='emoticon-activate'>
<legend class='e-hideme'>".EMOLAN_1."</legend>
<legend'>".EMOLAN_1."</legend>
<table cellpadding='0' cellspacing='0' class='adminlist'>
<colgroup span='2'>
<col style='width:30%' />
@ -171,7 +171,7 @@ class emotec
$text .= "
<form method='post' action='".e_SELF."#etabTabContainer=emoticon-packages'>
<fieldset id='emoticon-packages'>
<legend class='e-hideme'>".EMOLAN_13."</legend>
<legend>".EMOLAN_13."</legend>
<table cellpadding='0' cellspacing='0' class='adminlist'>
<colgroup span='4'>
<col style='width:15%' />

View File

@ -9,8 +9,8 @@
* Administration Area - Site Links
*
* $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $
* $Revision: 1.19 $
* $Date: 2008-12-21 12:53:11 $
* $Revision: 1.20 $
* $Date: 2009-01-16 17:57:56 $
* $Author: secretr $
*
*/
@ -189,29 +189,30 @@ if(isset($_POST['add_link']))
$linkArray = $linkpost->getLinks();
if($action == 'create')
{
$linkpost->create_link($sub_action, $id);
}
switch ($action) {
case 'create':
$linkpost->create_link($sub_action, $id);
break;
if(!e_QUERY || $action == 'main')
{
$linkpost->show_existing_items();
}
case 'debug':
$linkpost->show_existing_items(TRUE);
break;
if($action == 'debug')
{
$linkpost->show_existing_items(TRUE);
}
case 'opt':
$linkpost->show_pref_options();
break;
if($action == 'opt')
{
$linkpost->show_pref_options();
}
case 'sublinks':
$linkpost->show_sublink_generator();
break;
if($action == "sublinks")
{
$linkpost->show_sublink_generator();
case 'savepreset':
case 'clr_preset':
default: //handles preset urls as well
$action = 'main';
$sub_action = $id = '';
$linkpost->show_existing_items();
break;
}
require_once ('footer.php');
@ -488,6 +489,9 @@ class links
function create_link($sub_action, $id)
{
global $sql, $e107, $pst, $tp, $emessage;
$frm = new e_form();
$preset = $pst->read_preset("admin_links");
extract($preset);
@ -560,34 +564,14 @@ class links
<tr>
<td class='label'>".LCLAN_18.": </td>
<td class='control'>
<input class='tbox input-text' type='text' id='link_button' name='link_button' size='42' value='{$link_button}' maxlength='100' />
<button class='submit' type='button' value='".LCLAN_39."' onclick='e107Helper.toggle(\"linkicn\")'><span>".LCLAN_39."</span></button>
<div id='linkicn' class='e-hideme'>
<div class='expand-container'>
";
//SecretR - more nice view
$tmp = array('_16', '_32', '_48', '_64', '_128');
$tmp1 = array();
foreach($iconlist as $icon)
{
$filepath = str_replace(e_IMAGE."icons/", "", $icon['path'].$icon['fname']);
$str = "<a href='#' onclick=\"e107Helper.insertText('".$filepath."','link_button','linkicn'); return false; \"><img class='icon list' src='".$icon['path'].$icon['fname']."' alt='' /></a>";
foreach ($tmp as $isize)
{
if(strpos($filepath, $isize) !== false)
{
$tmp1[$isize] = varset($tmp1[$isize]).$str;
continue 2;
}
}
$tmp1['other'] = varset($tmp1['other']).$str;//other
}
$text .= $tmp1 ? '<div class="clear">'.implode('</div><div class="clear">', $tmp1).'</div>' : '';
unset($tmp, $tmp1);
//End view
//SecretR - more nice view now handled by e_form (inner use of new sc {ICONPICKER})
//Example sc opts (4th func argument)
//$opts = 'path='.e_IMAGE.'icons/|'.e_IMAGE.'generic/';
//$opts .= '&path_omit='.e_IMAGE.'icons/';
$text .= $frm->iconpicker('link_button', $link_button, LCLAN_39);
// 1 = _blank
// 2 = _parent not in use.
@ -599,8 +583,7 @@ class links
$text .= "
</div>
</div>
</td>
</tr>
<tr>

View File

@ -9,8 +9,8 @@
* News Administration
*
* $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
* $Revision: 1.21 $
* $Date: 2009-01-15 15:42:24 $
* $Revision: 1.22 $
* $Date: 2009-01-16 17:57:56 $
* $Author: secretr $
*/
require_once("../class2.php");
@ -47,6 +47,18 @@ function headerjs()
'Helper': true,
'AdminMenu': false
}
//fix form action if needed
document.observe('dom:loaded', function() {
if($('core-newspost-create-form')) {
$('core-newspost-create-form').observe('submit', function(event) {
var form = event.element();
action = form.readAttribute('action') + document.location.hash;
if($('create-edit-stay-1') && $('create-edit-stay-1').checked)
form.writeAttribute('action', action);
});
}
});
</script>
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
";
@ -335,17 +347,24 @@ class admin_newspost
$_POST['cat_id'] = 1;
}
if(isset($_POST['news_thumbnail']))
{
$_POST['news_thumbnail'] = urldecode(basename($_POST['news_thumbnail']));
}
$tmp = explode(chr(35), $_POST['news_author']);
$_POST['news_author'] = $tmp[0];
//$this->show_message($ix->submit_item($_POST), E_MESSAGE_SUCCESS, true);
//unset($_POST['news_title'], $_POST['cat_id'], $_POST['data'], $_POST['news_extended'], $_POST['news_allow_comments'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['news_id'], $_POST['news_class']);
$ix->submit_item($_POST, true);
$sess = !(isset($_POST['create_edit_stay']) && !empty($_POST['create_edit_stay']));
$ix->submit_item($_POST, $sess);
$this->clear_cache();
session_write_close();
header('Location:'.e_SELF);
exit;
if($sess)
{
session_write_close();
header('Location:'.e_SELF);
exit;
}
}
function _observe_create_category()
@ -512,7 +531,7 @@ class admin_newspost
$sicon = (file_exists(THEME_ABS."images/sticky.png") ? THEME_ABS."images/sticky.png" : e_IMAGE_ABS."generic/sticky.png");
$text .= " <img src='".$sicon."' alt='' />";
}
//TODO - remove onclick events
$text .= "
</td>
<td class='center'>
@ -651,6 +670,11 @@ class admin_newspost
}
$text .= "
<div class='admintabs' id='tab-container'>
<ul class='e-tabs e-hideme' id='core-emote-tabs'>
<li id='tab-general'><a href='#core-newspost-create'>".LAN_NEWS_52."</a></li>
<li id='tab-advanced'><a href='#core-newspost-edit-options'>".LAN_NEWS_53."</a></li>
</ul>
<form method='post' action='".e_SELF."?".e_QUERY."' id='core-newspost-create-form' ".(FILE_UPLOADS ? "enctype='multipart/form-data'" : "")." >
<fieldset id='core-newspost-create'>
<legend>".LAN_NEWS_52."</legend>
@ -851,7 +875,7 @@ class admin_newspost
$parms .= "&path=".e_IMAGE."newspost_images/";
$parms .= "&filter=0";
$parms .= "&fullpath=1";
$parms .= "&default=".urlencode('{e_IMAGE}newspost_images/'.$_POST['news_thumbnail']);
$parms .= "&default=".urlencode(basename($_POST['news_thumbnail']));
$parms .= "&multiple=FALSE";
$parms .= "&label=-- ".LAN_NEWS_48." --";
$parms .= "&subdirs=0";
@ -1065,10 +1089,11 @@ class admin_newspost
<div class='buttons-bar center'>
".$frm->admin_button('preview', isset($_POST['preview']) ? NWSLAN_24 : NWSLAN_27 , 'submit')."
".$frm->admin_button('submit_news', ($id && $sub_action != "sn" && $sub_action != "upload") ? NWSLAN_25 : NWSLAN_26 , 'update')."
".$frm->checkbox('create_edit_stay', 1, isset($_POST['create_edit_stay'])).$frm->label(LAN_NEWS_54, 'create_edit_stay', 1)."
<input type='hidden' name='news_id' value='{$id}' />
</div>
</form>
</div>
";
@ -1138,7 +1163,7 @@ class admin_newspost
$_PR['news_summary'] = $e107->tp->post_toHTML($_PR['news_summary']);
$_PR['news_extended'] = $e107->tp->post_toHTML($_PR['news_extended']);
$_PR['news_file'] = $_POST['news_file'];
$_PR['news_image'] = $_POST['news_image'];
$_PR['news_thumbnail'] = basename($_POST['news_thumbnail']);
//$ix->render_newsitem($_PR);
@ -1167,26 +1192,23 @@ class admin_newspost
$emessage->add($message, $type, $session);
}
function show_categories($sub_action, $id)
function show_categories()
{
global $sql, $rs, $ns, $tp, $frm;
$handle = opendir(e_IMAGE."icons");
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file != "/" && $file != "null.txt" && $file != "CVS") {
$iconlist[] = $file;
}
}
closedir($handle);
require_once(e_HANDLER."userclass_class.php");
require_once(e_HANDLER."form_handler.php");
$frm = new e_form(true); //enable inner tabindex counter
if ($sub_action == "edit") {
if ($sql->db_Select("news_category", "*", "category_id='$id' ")) {
$row = $sql->db_Fetch();
extract($row);
$e107 = &e107::getInstance();
$category = array();
if ($this->getSubAction() == "edit") {
if ($e107->sql->db_Select("news_category", "*", "category_id=".$this->getId())) {
$category = $e107->sql->db_Fetch();
}
}
$text = "
<form method='post' action='".e_SELF."?cat' id='core-newspost-cat-create'>
<form method='post' action='".e_SELF."?cat' id='core-newspost-cat-create-form'>
<fieldset id='core-newspost-cat-create'>
<legend>".NWSLAN_56."</legend>
<table cellpadding='0' cellspacing='0' class='adminform'>
@ -1198,42 +1220,29 @@ class admin_newspost
<tr>
<td class='label'>".NWSLAN_52."</td>
<td class='control'>
".$frm->text('category_name', $category_name, 200)."
".$frm->text('category_name', $category['category_name'], 200)."
</td>
</tr>
<tr>
<td class='label'>".NWSLAN_53."</td>
<td class='control'>
<div class='field-spacer'>
".$frm->text('category_button', $category_icon, 100)."
</div>
<div class='field-spacer'>
".$frm->admin_button('view_images', NWSLAN_54, 'action', NWSLAN_54, array('other'=>"onclick='e107Helper.toggle(\"caticn\")'"))."
</div>
<div id='caticn' class='e-hideme'>
";
while (list($key, $icon) = each($iconlist)) {
$text .= "
<a href=\"javascript:insertext('$icon','category_button','caticn')\"><img src='".e_IMAGE."icons/".$icon."' alt='' /></a>
";
}
$text .= "
</div>
".$frm->iconpicker('category_button', $category['category_icon'], NWSLAN_54)."
</td>
</tr>
</tbody>
</table>
<div class='buttons-bar center'>
";
if ($id) {
if($category)
{
$text .= "
".$frm->admin_button('update_category', NWSLAN_55, 'update')."
".$frm->admin_button('category_clear', NWSLAN_79)."
".$frm->hidden("category_id", $id)."
".$frm->admin_button('category_clear', LAN_CANCEL, 'cancel')."
".$frm->hidden("category_id", $this->getId())."
";
} else {
}
else
{
$text .= "
".$frm->admin_button('create_category', NWSLAN_56, 'create')."
";
@ -1245,9 +1254,6 @@ class admin_newspost
</form>
";
//$ns->tablerender(NWSLAN_56, $text);
unset($category_name, $category_icon);
//XXX LAN - Icon
$text .= "
<form action='".e_SELF."?cat' id='newscatform' method='post'>
@ -1270,22 +1276,22 @@ class admin_newspost
</thead>
<tbody>
";
if ($category_total = $sql->db_Select("news_category")) {
while ($row = $sql->db_Fetch()) {
extract($row);
if ($category_total = $e107->sql->db_Select("news_category")) {
while ($category = $e107->sql->db_Fetch()) {
if ($category_icon) {
$icon = (strstr($category_icon, "images/") ? THEME."$category_icon" : e_IMAGE."icons/$category_icon");
if ($category['category_icon']) {
$icon = (strstr($category['category_icon'], "images/") ? THEME_ABS.$category['category_icon'] : e_IMAGE_ABS."icons/".$category['category_icon']);
}
$text .= "
<tr>
<td class='center'>{$category_id}</td>
<td class='center'><img src='$icon' alt='' style='vertical-align:middle' /></td>
<td>$category_name</td>
<td class='center'>{$category['category_id']}</td>
<td class='center'><img class='icon action' src='{$icon}' alt='' /></td>
<td>{$category['category_name']}</td>
<td class='center'>
<a href='".e_SELF."?cat.edit.{$category_id}'>".ADMIN_EDIT_ICON."</a>
<input type='image' title='".LAN_DELETE."' name='delete[category_{$category_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(NWSLAN_37." [ID: $category_id ]")."') \"/>
<a href='".e_SELF."?cat.edit.{$category['category_id']}'>".ADMIN_EDIT_ICON."</a>
".$frm->submit_image("delete[category_{$category['category_id']}]", $category['category_id'], 'delete', $e107->tp->toJS(NWSLAN_37." [ID: {$category['category_id']} ]"))."
</td>
</tr>
";
@ -1304,7 +1310,7 @@ class admin_newspost
</form>
";
$ns->tablerender(NWSLAN_46, $text);
$e107->ns->tablerender(NWSLAN_46, $text);
}

View File

@ -9,8 +9,8 @@
* Administration - Site Preferences
*
* $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $
* $Revision: 1.26 $
* $Date: 2009-01-15 15:42:24 $
* $Revision: 1.27 $
* $Date: 2009-01-16 17:57:56 $
* $Author: secretr $
*
*/
@ -1152,10 +1152,6 @@ function headerjs()
{
require_once(e_HANDLER.'js_helper.php');
$ret = "
<script type='text/javascript'>
//add required core lan - delete confirm message
(".e_jshelper::toString(LAN_JSCONFIRM).").addModLan('core', 'delete_confirm');
</script>
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
";

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_files/e_ajax.php,v $
| $Revision: 1.5 $
| $Date: 2008-11-09 20:33:24 $
| $Revision: 1.6 $
| $Date: 2009-01-16 17:57:57 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
@ -36,7 +36,7 @@ ob_implicit_flush(0);
if($_POST['ajax_sc'] && $_POST['ajax_used'])
{
list($fld,$parm) = explode("=",$_POST['ajax_sc']);
$prm = ($parm) ? "=".$parm : "";
$prm = ($parm) ? "=".urldecode($parm) : "";
echo $tp->parseTemplate("{".strtoupper($fld).$prm."}",TRUE,$shortcodes);
exit;
}

View File

@ -8,8 +8,8 @@
* e107 Javascript API
*
* $Source: /cvs_backup/e107_0.8/e107_files/jslib/e107.js.php,v $
* $Revision: 1.22 $
* $Date: 2009-01-16 00:54:33 $
* $Revision: 1.23 $
* $Date: 2009-01-16 17:57:57 $
* $Author: secretr $
*
*/
@ -2446,6 +2446,7 @@ Object.extend(e107Ajax, {
if(!opt.parameters) opt.parameters = {};
Object.extend(opt.parameters, parm || {});
opt.method = 'post';
if ($(form).hasAttribute('method') && !opt.method)
opt.method = $(form).method;
@ -2462,6 +2463,39 @@ Object.extend(e107Ajax, {
submitFormSC: function(form, sc, scfile, container) {
var handler = ('#{e_FILE}e_ajax.php'), parm = { 'ajax_sc': sc, 'ajax_scfile': scfile };
return this.submitForm(form, varsettrue(container, sc), { parameters: parm, overlayElement: varsettrue(container, sc) }, handler);
},
toggleUpdate: function(toggle, container, url, cacheid, options) {
container = $(container);
toggle = $(toggle);
opt = Object.clone(options || {});
opt.method = 'post';
if(!toggle) return;
if(!toggle.visible())
{
if(cacheid && $(cacheid)) return toggle.fxToggle();
opt.onComplete = function() { toggle.fxToggle() };
if(url.startsWith('sc:'))
{
return e107Ajax.scUpdate(url.substring(3), container, opt);
}
return new e107Ajax.Updater(container, url, opt);
}
return toggle.fxToggle();
},
scUpdate: function(sc, container, options) {
var handler = ('#{e_FILE}e_ajax.php').parsePath(), parm = { 'ajax_sc': sc };
opt = Object.clone(options || {});
opt.method = 'post';
if(!opt.parameters) opt.parameters = {};
Object.extend(opt.parameters, parm || {});
return new e107Ajax.Updater(container, handler, opt);
}
});

View File

@ -0,0 +1,67 @@
<?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 $
*
* Image picker shortcode
*
*/
function iconpicker_shortcode($parm)
{
require_once (e_HANDLER."file_class.php");
require_once(e_HANDLER.'admin_handler.php');
$e107 = &e107::getInstance();
$fl = new e_file();
$parms = array();
parse_str($parm, $parms);
if(!varset($parms['path']))
{
$parms['path'] = e_IMAGE."icons/";
$parms['path_omit'] = e_IMAGE."icons/";
}
$parms['path'] = explode('|', $parms['path']);
$iconlist = array();
foreach($parms['path'] as $iconpath)
{
$tmp = $fl->get_files($iconpath, '\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG');
if($tmp)
{
$iconlist += $tmp;
}
unset($tmp);
}
$iconlist = multiarray_sort($iconlist, 'fname');
$tmp = array(16, 32, 48, 64, 128);
$tmp1 = array();
$name = varset($parms['id']);
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'];
$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']);
$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['fname'], '_'.$isize.'.') !== false)
{
$tmp1[$isize] = varset($tmp1[$isize]).str_replace('%%size%%', ' S'.$isize, $str);
continue 2;
}
}
$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>' : '';
}
?>

View File

@ -1,5 +1,5 @@
// $Id: imageselector.sc,v 1.8 2008-12-17 17:27:07 secretr Exp $
// $Id: imageselector.sc,v 1.9 2009-01-16 17:57:56 secretr Exp $
//FIXME - full rewrite, backward compatible
global $sql,$parm,$tp;
@ -36,13 +36,10 @@ if($scaction == 'select' || $scaction == 'all')
foreach($paths as $pths)
{
$imagelist += $fl->get_files($pths,'\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG', 'standard', $recurse);
$imagelist[$tp->createConstants($pths, 1)]= $fl->get_files($pths,'\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG', 'standard', $recurse);
}
if($imagelist)
{
sort($imagelist);
}
if(!$fullpath && (count($paths) > 1))
{
@ -54,21 +51,35 @@ if($scaction == 'select' || $scaction == 'all')
$height = ($height) ? $height : "0";
$label = ($label) ? $label : " -- -- ";
$tabindex = varset($tabindex) ? " tabindex='{$tabindex}'" : '';
$class = varset($class) ? " class='{$class}'" : " class='tbox'";
$class = varset($class) ? " class='{$class}'" : " class='tbox imgselector'";
$text .= "<select{$multi}{$tabindex}{$class} name='{$name}' id='{$name}' onchange=\"replaceSC('imagepreview={$name}|{$width}|{$height}',this.form,'{$name}_prev'); \">
<option value=''>".$label."</option>\n";
foreach($imagelist as $icon)
require_once(e_HANDLER.'admin_handler.php');
foreach($imagelist as $imagedirlabel => $icons)
{
$dir = str_replace($paths,"",$icon['path']);
if(!$filter || ($filter && ereg($filter,$dir.$icon['fname'])))
$text .= "<optgroup label='".$tp->replaceConstants($imagedirlabel, TRUE)."'>";
if(empty($icons)) $text .= "<option value=''>Empty</option>\n";
else
{
$pth = ($fullpath) ? $tp->createConstants($icon['path'],1) : $dir;
$selected = ($default == $pth.$icon['fname']) ? " selected='selected'" : "";
$text .= "<option value='{$pth}{$icon['fname']}'{$selected}>{$dir}{$icon['fname']}</option>\n";
}
$icons = multiarray_sort($icons, 'fname');
foreach($icons as $icon)
{
$dir = str_replace($paths,"",$icon['path']);
if(!$filter || ($filter && ereg($filter,$dir.$icon['fname'])))
{
$pth = ($fullpath) ? $tp->createConstants($icon['path'],1) : $dir;
$selected = ($default == $pth.$icon['fname'] || $pth.$default == $pth.$icon['fname']) ? " selected='selected'" : "";
$text .= "<option value='{$pth}{$icon['fname']}'{$selected}>&nbsp;&nbsp;&nbsp;{$dir}{$icon['fname']}</option>\n";
}
}
}
$text .= '</optgroup>';
}
$text .= "</select>";

View File

@ -9,8 +9,8 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
* $Revision: 1.15 $
* $Date: 2009-01-15 15:42:24 $
* $Revision: 1.16 $
* $Date: 2009-01-16 17:57:56 $
* $Author: secretr $
*
*/
@ -78,6 +78,24 @@ class e_form
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
}
function iconpicker($name, $default, $label, $sc_parameters = '', $ajax = true)
{
$e107 = &e107::getInstance();
$id = $this->name2id($name);
$sc_parameters .= '&id='.$id;
$jsfunc = $ajax ? "e107Ajax.toggleUpdate('{$id}-iconpicker', '{$id}-iconpicker-cn', 'sc:iconpicker=".urlencode($sc_parameters)."', '{$id}-iconpicker-ajax', { overlayElement: '{$id}-iconpicker-button' })" : "e107Helper.toggle('{$id}-iconpicker')";
$ret = $this->text($name, $default).$this->admin_button($name.'-iconpicker-button', $label, 'action', '', array('other' => "onclick=\"{$jsfunc}\""));
$ret .= "
<div id='{$id}-iconpicker' class='e-hideme'>
<div class='expand-container' id='{$id}-iconpicker-cn'>
".(!$ajax ? $e107->tp->parseTemplate('{ICONPICKER='.$sc_parameters.'}') : '')."
</div>
</div>
";
return $ret;
}
function file($name, $options = array())
{
$options = $this->format_options('file', $name, $options);
@ -320,14 +338,14 @@ class e_form
* @param string $id_value value for attribute id passed with the option array
* @param string $name the name attribute passed to that field
* @param unknown_type $value the value attribute passed to that field
* @return unknown
* @return string formatted id attribute
*/
function _format_id($id_value, $name, $value = '', $return_attribute = 'id')
{
if($id_value === false) return '';
//format data first
$name = rtrim(str_replace(array('[]', '[', ']', '_'), array('-', '-', '', '-'), $name), '-');
$name = $this->name2id($name);
$value = trim(preg_replace('#[^a-z0-9\-]/i#','-', $value), '-');
if(!$id_value && is_numeric($value)) $id_value = $value;
@ -337,6 +355,11 @@ class e_form
else return " {$return_attribute}='{$id_value}'";
}
function name2id($name)
{
return rtrim(str_replace(array('[]', '[', ']', '_'), array('-', '-', '', '-'), $name), '-');
}
/**
* Format options based on the field type,

View File

@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/preset_class.php,v $
| $Revision: 1.3 $
| $Date: 2009-01-15 15:42:24 $
| $Revision: 1.4 $
| $Date: 2009-01-16 17:57:56 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
@ -94,7 +94,7 @@ class e_preset
$del = $_POST['del_id'];
$check = $sql->db_Delete("preset", "preset_name ='".$unique_id[$del]."' ");
if(!$output)
if($output)
{
$ns->tablerender(LAN_SAVED, $check ? LAN_PRESET_DELETED : LAN_DELETED_FAILED);
return;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 829 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 888 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 755 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 801 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 B

View File

@ -4,8 +4,8 @@
| e107 website system - Language File.
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_newspost.php,v $
| $Revision: 1.5 $
| $Date: 2009-01-15 15:42:24 $
| $Revision: 1.6 $
| $Date: 2009-01-16 17:57:56 $
| $Author: secretr $
+----------------------------------------------------------------------------+
*/
@ -86,7 +86,7 @@ define("NWSLAN_76", "Title only - post to front page");
define("NWSLAN_77", "Post to other news menu");
// define("NWSLAN_78", "This option is disabled as file uploading is not enabled on your server"); // deprecated see lan_admin.php
define("NWSLAN_79","Clear Form");
//define("NWSLAN_79","Clear Form");
define("NWSLAN_83","Extended news post");
define("NWSLAN_84","Choose which visitors will see news item");
@ -171,5 +171,6 @@ define("LAN_NEWS_50", "Author");
define("LAN_NEWS_51", "Modification of the news-item author can be done by:");
define("LAN_NEWS_52", "General Information");
define("LAN_NEWS_53", "News Item Options");
define("LAN_NEWS_53", "Advanced Options");
define("LAN_NEWS_54", "stay in edit mode");
?>

View File

@ -214,6 +214,7 @@ label { cursor: pointer; }
.admintabs ul.e-tabs { border-bottom: 1px solid #DDDDDD; height: 31px; }
.admintabs ul.e-tabs li { border: 1px solid #DDDDDD; display: block; float: left; line-height: 30px; padding: 0px 7px; margin-right: 3px; background-color: #F9F9F9 }
.admintabs fieldset { clear: both ; border: 1px solid #DDDDDD; padding: 10px; border-top: 0px none; }
.admintabs fieldset legend { border: 1px solid #DDDDDD; }
.admintabs ul.e-tabs li.active { border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF}
/******** SyS Messages / Message text formatting */

View File

@ -34,7 +34,15 @@ function theme_head() {
e107Utils.Decorate.table(element, {tr_td: 'first last'});
});
element.select('div.admintabs').each(function(element) {
//show tab navaigation
element.select('ul.e-tabs').each( function(el){
el.show();
el.removeClassName('e-hideme');//prevent hideme re-register (e.g. ajax load)
});
//init tabs
new e107Widgets.Tabs(element);
//hide legends if any
element.select('legend').invoke('hide');
});
}, document, true);