1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

content: ideas 1228 : added option to use all icons or just the 'tmp' icons (for both icons and attachments). Useful if you want to reuse the same icons and attachments in multiple content items

This commit is contained in:
lia
2007-04-18 21:41:58 +00:00
parent 91d45d6eb3
commit 04d8264594
4 changed files with 56 additions and 24 deletions

View File

@@ -1485,31 +1485,37 @@ if($show['enddate']===true){
SC_END SC_END
SC_BEGIN CONTENTFORM_UPLOAD SC_BEGIN CONTENTFORM_UPLOAD
global $row, $rs, $show, $checkicon, $checkattach, $checkimages, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image; global $row, $rs, $show, $content_pref;
if($show['upload']===true){ if($show['upload']===true){
$text = ""; $text = "";
if(!FILE_UPLOADS){ if(!FILE_UPLOADS){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>"; $text .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>";
}else{ }else{
if(!is_writable($content_tmppath_icon)){ if($show['icon']===true){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />"; if(!is_writable($content_pref['content_icon_path_tmp'])){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_pref['content_icon_path_tmp']." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
}
} }
if(!is_writable($content_tmppath_file)){ if($show['attach']===true){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />"; if(!is_writable($content_pref['content_file_path_tmp'])){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_pref['content_file_path_tmp']." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
}
} }
if(!is_writable($content_tmppath_image)){ if($show['images']===true){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />"; if(!is_writable($content_pref['content_image_path_tmp'])){
$text .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_pref['content_image_path_tmp']." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
}
} }
$text .= "<br /> $text .= "<br />
<input class='tbox' type='file' name='file_userfile[]' size='36' /> <input class='tbox' type='file' name='file_userfile[]' size='36' />
".$rs -> form_select_open("uploadtype")." ".$rs -> form_select_open("uploadtype")."
".($checkicon ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')." ".($show['icon'] ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1") : '')."
".($checkattach ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')." ".($show['attach'] ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2") : '')."
".($checkimages ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')." ".($show['images'] ? $rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3") : '')."
".$rs -> form_select_close()." ".$rs -> form_select_close()."
<input type='hidden' name='tmppathicon' value='".$content_tmppath_icon."' /> ".($show['icon'] ? "<input type='hidden' name='tmppathicon' value='".$content_pref['content_icon_path_tmp']."' />" : '')."
<input type='hidden' name='tmppathfile' value='".$content_tmppath_file."' /> ".($show['attach'] ? "<input type='hidden' name='tmppathfile' value='".$content_pref['content_file_path_tmp']."' />" : '')."
<input type='hidden' name='tmppathimage' value='".$content_tmppath_image."' /> ".($show['images'] ? "<input type='hidden' name='tmppathimage' value='".$content_pref['content_image_path_tmp']."' />" : '')."
<input class='button' type='submit' name='uploadfile' value='".CONTENT_ADMIN_ITEM_LAN_104."' />"; <input class='button' type='submit' name='uploadfile' value='".CONTENT_ADMIN_ITEM_LAN_104."' />";
} }
$text .= "<br />"; $text .= "<br />";
@@ -1528,9 +1534,9 @@ if($show['icon']===true){
}else{ }else{
foreach($iconlist as $icon){ foreach($iconlist as $icon){
if(file_exists($icon['path']."thumb_".$icon['fname'])){ if(file_exists($icon['path']."thumb_".$icon['fname'])){
$img = "<img src='".$icon['path']."thumb_".$icon['fname']."' style='width:100px; border:0' alt='' />"; $img = "<img src='".$icon['path']."thumb_".$icon['fname']."' style='width:50px; border:0' alt='' />";
}else{ }else{
$img = "<img src='".$icon['path'].$icon['fname']."' style='width:100px; border:0' alt='' />"; $img = "<img src='".$icon['path'].$icon['fname']."' style='width:50px; border:0' alt='' />";
} }
$text .= "<a href=\"javascript:insertext('".$icon['fname']."','content_icon','divicon')\">".$img."</a> "; $text .= "<a href=\"javascript:insertext('".$icon['fname']."','content_icon','divicon')\">".$img."</a> ";
} }

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_class.php,v $
| $Revision: 1.21 $ | $Revision: 1.22 $
| $Date: 2007-04-18 20:46:04 $ | $Date: 2007-04-18 21:41:58 $
| $Author: lisa_ $ | $Author: lisa_ $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@@ -54,6 +54,8 @@ class content{
$cp['content_admin_layout'] = ''; //should the option for choosing a layout template be shown $cp['content_admin_layout'] = ''; //should the option for choosing a layout template be shown
$cp['content_admin_customtags'] = ''; //should options for adding additional data be shown $cp['content_admin_customtags'] = ''; //should options for adding additional data be shown
$cp['content_admin_presettags'] = ''; //should preset data tags be shown $cp['content_admin_presettags'] = ''; //should preset data tags be shown
$cp['content_admin_loadicons'] = 0; //load all icons, or only the 'tmp' icons, when assigning an icon
$cp['content_admin_loadattach'] = 0; //load all attachments, or only the 'tmp' attachments, when assigning an attachment
//ADMIN CREATE CATEGORY FORM //ADMIN CREATE CATEGORY FORM
$cp['content_admincat_subheading'] = '1'; //should subheading be available $cp['content_admincat_subheading'] = '1'; //should subheading be available

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/content/handlers/content_form_class.php,v $
| $Revision: 1.16 $ | $Revision: 1.17 $
| $Date: 2007-04-18 21:13:23 $ | $Date: 2007-04-18 21:41:58 $
| $Author: lisa_ $ | $Author: lisa_ $
+---------------------------------------------------------------+ +---------------------------------------------------------------+
*/ */
@@ -213,7 +213,7 @@ class contentform{
} }
function show_create_content($mode, $userid="", $username=""){ function show_create_content($mode, $userid="", $username=""){
global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $content_shortcodes, $content_pref, $plugintable, $plugindir, $pref, $eArrayStorage, $message, $row, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id, $months, $ne_day, $ne_month, $ne_year, $current_year, $end_day, $end_month, $end_year, $checkicon, $checkattach, $checkimages, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image, $iconlist, $checkattachnumber, $filelist, $checkimagesnumber, $imagelist, $CONTENTFORM_CATEGORY, $CONTENTFORM_CUSTOM, $CONTENTFORM_CUSTOM_KEY, $CONTENTFORM_CUSTOM_VALUE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, $CONTENTFORM_PRESET, $CONTENT_ADMIN_CONTENT_CREATE, $CONTENT_ADMIN_BUTTON; global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $content_shortcodes, $content_pref, $plugintable, $plugindir, $pref, $eArrayStorage, $message, $row, $show, $content_author_name_value, $content_author_name_js, $content_author_email_value, $content_author_email_js, $content_author_id, $months, $ne_day, $ne_month, $ne_year, $current_year, $end_day, $end_month, $end_year, $content_tmppath_icon, $content_tmppath_file, $content_tmppath_image, $iconlist, $checkattachnumber, $filelist, $checkimagesnumber, $imagelist, $CONTENTFORM_CATEGORY, $CONTENTFORM_CUSTOM, $CONTENTFORM_CUSTOM_KEY, $CONTENTFORM_CUSTOM_VALUE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMSTART, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMTABLE, $CONTENT_ADMIN_CONTENT_CREATE_CUSTOMEND, $CONTENTFORM_PRESET, $CONTENT_ADMIN_CONTENT_CREATE, $CONTENT_ADMIN_BUTTON;
$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11); $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
@@ -610,14 +610,22 @@ class contentform{
$show['upload'] = false; $show['upload'] = false;
} }
if($checkicon){ if($checkicon){
$iconlist = $fl->get_files($content_pref['content_icon_path_tmp'],"",$rejectlist); $list1 = $fl->get_files($content_pref['content_icon_path_tmp'],"",$rejectlist);
if(varsettrue($content_pref['content_admin_loadicons'])){
$list2 = $fl->get_files($content_pref['content_icon_path'],"",$rejectlist);
}
$iconlist = ($list2) ? array_merge($list1, $list2) : $list1;
$show['icon'] = true; $show['icon'] = true;
}else{ }else{
$show['icon'] = false; $show['icon'] = false;
$hidden .= $rs -> form_hidden("content_icon", $row['content_icon']); $hidden .= $rs -> form_hidden("content_icon", $row['content_icon']);
} }
if($checkattach){ if($checkattach){
$filelist = $fl->get_files($content_pref['content_file_path_tmp'],"",$rejectlist); $list1 = $fl->get_files($content_pref['content_file_path_tmp'],"",$rejectlist);
if(varsettrue($content_pref['content_admin_loadattach'])){
$list2 = $fl->get_files($content_pref['content_file_path'],"",$rejectlist);
}
$filelist = ($list2) ? array_merge($list1, $list2) : $list1;
$show['attach'] = true; $show['attach'] = true;
}else{ }else{
$show['attach'] = false; $show['attach'] = false;
@@ -1860,6 +1868,20 @@ class contentform{
$TOPIC_FIELD .= $rs -> form_select_close(); $TOPIC_FIELD .= $rs -> form_select_close();
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND); $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
//content_admin_loadicons
$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_176;
$TOPIC_FIELD = "
".$rs -> form_radio("content_admin_loadicons", "1", ($content_pref['content_admin_loadicons'] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
".$rs -> form_radio("content_admin_loadicons", "0", ($content_pref['content_admin_loadicons'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31;
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
//content_admin_loadattach
$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_177;
$TOPIC_FIELD = "
".$rs -> form_radio("content_admin_loadattach", "1", ($content_pref['content_admin_loadattach'] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
".$rs -> form_radio("content_admin_loadattach", "0", ($content_pref['content_admin_loadattach'] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31;
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
//content_admin_custom_preset_ //content_admin_custom_preset_
$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_6; $TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_6;
$TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_7; $TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_7;

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/languages/English/lan_content_admin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/content/languages/English/lan_content_admin.php,v $
| $Revision: 1.10 $ | $Revision: 1.11 $
| $Date: 2007-04-10 14:34:39 $ | $Date: 2007-04-18 21:41:58 $
| $Author: lisa_ $ | $Author: lisa_ $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -691,4 +691,6 @@ define("CONTENT_ADMIN_OPT_LAN_172", "numeric value to show that amount of levels
define("CONTENT_ADMIN_OPT_LAN_173", "include 'home' in the breadcrumb"); define("CONTENT_ADMIN_OPT_LAN_173", "include 'home' in the breadcrumb");
define("CONTENT_ADMIN_OPT_LAN_174", "include the content start page in the breadcrumb"); define("CONTENT_ADMIN_OPT_LAN_174", "include the content start page in the breadcrumb");
define("CONTENT_ADMIN_OPT_LAN_175", "show menu only on content pages of this top level category?"); define("CONTENT_ADMIN_OPT_LAN_175", "show menu only on content pages of this top level category?");
define("CONTENT_ADMIN_OPT_LAN_176", "when assigning an icons, load all icons ? (default is disabled = only load tmp icons) useful if you want to reuse the same icons");
define("CONTENT_ADMIN_OPT_LAN_177", "when assigning an attachment, load all ? (default is disabled = only load tmp attachments) useful if you want to reuse the same attachments");
?> ?>