From: <w4...@us...> - 2003-01-06 20:23:59
|
Update of /cvsroot/xoops/xoops2/modules/news/admin In directory sc8-pr-cvs1:/tmp/cvs-serv1018/modules/news/admin Modified Files: index.php Log Message: added the image selector for the news topic image (admin) Index: index.php =================================================================== RCS file: /cvsroot/xoops/xoops2/modules/news/admin/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.php 2 Jan 2003 18:59:09 -0000 1.1 --- index.php 6 Jan 2003 20:23:50 -0000 1.2 *************** *** 27,30 **** --- 27,31 ---- include "admin_header.php"; include_once XOOPS_ROOT_PATH."/class/xoopstopic.php"; + include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; include_once XOOPS_ROOT_PATH."/modules/news/class/class.newsstory.php"; if (isset($HTTP_POST_VARS)) { *************** *** 130,133 **** --- 131,135 ---- echo "<h4>"._AM_CONFIG."</h4>"; $xt = new XoopsTopic($xoopsDB->prefix("topics")); + $topics_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/news/images/topics/"); //$xoopsModule->printAdminMenu(); //echo "<br />"; *************** *** 137,142 **** echo "<h4>"._AM_ADDMTOPIC."</h4><br />"; echo "<b>"._AM_TOPICNAME."</b> "._AM_MAX40CHAR."<br /><input type='text' name='topic_title' size='20' maxlength='20' /><br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br /><input type='text' name='topic_imgurl' size='20' maxlength='20' /><br />"; ! echo "<br />"; echo "<input type='hidden' name='topic_pid' value='0' />\n"; echo "<input type='hidden' name='op' value='addTopic' />"; --- 139,148 ---- echo "<h4>"._AM_ADDMTOPIC."</h4><br />"; echo "<b>"._AM_TOPICNAME."</b> "._AM_MAX40CHAR."<br /><input type='text' name='topic_title' size='20' maxlength='20' /><br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br />"; ! echo "<select size='1' name='topic_imgurl'>"; ! foreach($topics_array as $image){ ! echo "<option value='".$image."'>".$image."</option>"; ! } ! echo "</select><br /><br />"; echo "<input type='hidden' name='topic_pid' value='0' />\n"; echo "<input type='hidden' name='op' value='addTopic' />"; *************** *** 154,161 **** $xt->makeTopicSelBox(0,0,"topic_pid"); echo "<br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br /><input type='text' name='topic_imgurl' size='20' maxlength='20' /><br />"; ! ! echo "<br />"; ! echo "<input type='hidden' name='op' value='addTopic' />"; echo "<input type='submit' value='"._AM_ADD."' /><br /></form>"; echo"</td></tr></table>"; --- 160,170 ---- $xt->makeTopicSelBox(0,0,"topic_pid"); echo "<br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br />"; ! echo "<select size='1' name='topic_imgurl'>"; ! foreach($topics_array as $image){ ! echo "<option value='".$image."'>".$image."</option>"; ! } ! echo "</select><br /><br />"; ! echo "<input type='hidden' name='op' value='addTopic' />"; echo "<input type='submit' value='"._AM_ADD."' /><br /></form>"; echo"</td></tr></table>"; *************** *** 181,194 **** global $xoopsModule; $xt = new XoopsTopic($xoopsDB->prefix("topics"), $HTTP_POST_VARS['topic_id']); xoops_cp_header(); echo "<h4>"._AM_CONFIG."</h4>"; //$xoopsModule->printAdminMenu(); //echo "<br />"; ! echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; ! echo "<h4>"._AM_MODIFYTOPIC."</h4><br />"; echo "<div style='text-align: right;'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/topics/".$xt->topic_imgurl()."'></div>"; echo "<form action='index.php' method='post'>"; echo "<b>"._AM_TOPICNAME."</b> "._AM_MAX40CHAR."<br /><input type='text' name='topic_title' size='20' maxlength='40' value='".$xt->topic_title()."' /><br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br /><input type='text' name='topic_imgurl' size='20' maxlength='20' value='".$xt->topic_imgurl()."' /><br />\n"; echo "<b>"._AM_PARENTTOPIC."<b><br />\n"; $xt->makeTopicSelBox(1, $xt->topic_pid(), "topic_pid"); --- 190,215 ---- global $xoopsModule; $xt = new XoopsTopic($xoopsDB->prefix("topics"), $HTTP_POST_VARS['topic_id']); + $topics_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/news/images/topics/"); xoops_cp_header(); echo "<h4>"._AM_CONFIG."</h4>"; //$xoopsModule->printAdminMenu(); //echo "<br />"; ! echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">"; ! echo "<h4>"._AM_MODIFYTOPIC."</h4><br />"; echo "<div style='text-align: right;'><img src='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/images/topics/".$xt->topic_imgurl()."'></div>"; echo "<form action='index.php' method='post'>"; echo "<b>"._AM_TOPICNAME."</b> "._AM_MAX40CHAR."<br /><input type='text' name='topic_title' size='20' maxlength='40' value='".$xt->topic_title()."' /><br />"; ! echo "<b>"._AM_TOPICIMG."</b> (". sprintf(_AM_IMGNAEXLOC,"modules/".$xoopsModule->dirname()."/images/topics/").")<br />"._AM_FEXAMPLE."<br />"; ! //echo "<input type='text' name='topic_imgurl' size='20' maxlength='20' value='".$xt->topic_imgurl()."' /><br />\n"; ! echo "<select size='1' name='topic_imgurl'>"; ! foreach($topics_array as $image){ ! if ( $image == $xt->topic_imgurl() ) { ! $opt_selected = "selected='selected'"; ! }else{ ! $opt_selected = ""; ! } ! echo "<option value='".$image."' $opt_selected>".$image."</option>"; ! } ! echo "</select><br />"; echo "<b>"._AM_PARENTTOPIC."<b><br />\n"; $xt->makeTopicSelBox(1, $xt->topic_pid(), "topic_pid"); |