From: <vo...@us...> - 2012-01-19 08:09:36
|
Revision: 8757 http://xoops.svn.sourceforge.net/xoops/?rev=8757&view=rev Author: voltan1 Date: 2012-01-19 08:09:27 +0000 (Thu, 19 Jan 2012) Log Message: ----------- Fix forms Modified Paths: -------------- XoopsModules/fmcontent/branches/news/admin/backend.php XoopsModules/fmcontent/branches/news/class/story.php XoopsModules/fmcontent/branches/news/class/topic.php XoopsModules/fmcontent/branches/news/submit.php Modified: XoopsModules/fmcontent/branches/news/admin/backend.php =================================================================== --- XoopsModules/fmcontent/branches/news/admin/backend.php 2012-01-19 07:35:40 UTC (rev 8756) +++ XoopsModules/fmcontent/branches/news/admin/backend.php 2012-01-19 08:09:27 UTC (rev 8757) @@ -178,7 +178,7 @@ } // file - if(isset($_REQUEST['file_name'])) { + if(isset($_FILES['file_name']['name']) && !empty($_FILES['file_name']['name'])) { $fileobj = $file_handler->create (); $fileobj->setVar ( 'file_date', time () ); $fileobj->setVar ( 'file_modid', $NewsModule->getVar ( 'mid' ) ); @@ -274,7 +274,7 @@ } // file - if(isset($_REQUEST['xoops_upload_file'])) { + if(isset($_FILES['file_name']['name']) && !empty($_FILES['file_name']['name'])) { $fileobj = $file_handler->create (); $fileobj->setVar ( 'file_date', time () ); $fileobj->setVar ( 'file_modid', $NewsModule->getVar ( 'mid' ) ); Modified: XoopsModules/fmcontent/branches/news/class/story.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/story.php 2012-01-19 07:35:40 UTC (rev 8756) +++ XoopsModules/fmcontent/branches/news/class/story.php 2012-01-19 08:09:27 UTC (rev 8757) @@ -120,7 +120,7 @@ $form->addElement ( new XoopsFormHidden ( 'story_topic', 0 ) ); } // Short - $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_CONTENT_SHORT, 'story_short', $this->getVar ( 'story_short', 'e' ), 5, 90 ) ); + $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_CONTENT_SHORT, 'story_short', $this->getVar ( 'story_short', 'e' ), 10, 90 ) ); // Editor $editor_tray = new XoopsFormElementTray ( _NEWS_AM_CONTENT_FORMTEXT, '<br />' ); if (class_exists ( 'XoopsFormEditor' )) { @@ -188,8 +188,8 @@ $file->setDescription ( _NEWS_AM_CONTENT_FILE_DESC ); $form->addElement ($file); // Metas - $form->addElement ( new XoopsFormTextArea ( 'Metas Keyword', 'story_words', $this->getVar ( 'story_words', 'e' ), 5, 90 ) ); - $form->addElement ( new XoopsFormTextArea ( 'Metas Description', 'story_desc', $this->getVar ( 'story_desc', 'e' ), 5, 90 ) ); + $form->addElement ( new XoopsFormTextArea ( 'Metas Keyword', 'story_words', $this->getVar ( 'story_words', 'e' ), 3, 50 ) ); + $form->addElement ( new XoopsFormTextArea ( 'Metas Description', 'story_desc', $this->getVar ( 'story_desc', 'e' ), 3, 50 ) ); // Content author $form->addElement ( new XoopsFormText ( _NEWS_AM_CONTENT_FORMAUTHOR, 'story_author', 50, 255, $this->getVar ( 'story_author', 'e' ) ), false ); // Content Source @@ -299,7 +299,7 @@ $form->addElement ( new XoopsFormHidden ( 'story_topic', 0 ) ); } // Short - $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_CONTENT_SHORT, 'story_short', $this->getVar ( 'story_short', 'e' ), 5, 80 ) ); + $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_CONTENT_SHORT, 'story_short', $this->getVar ( 'story_short', 'e' ), 10, 80 ) ); // Editor $editor_tray = new XoopsFormElementTray ( _NEWS_AM_CONTENT_FORMTEXT, '<br />' ); if (class_exists ( 'XoopsFormEditor' )) { Modified: XoopsModules/fmcontent/branches/news/class/topic.php =================================================================== --- XoopsModules/fmcontent/branches/news/class/topic.php 2012-01-19 07:35:40 UTC (rev 8756) +++ XoopsModules/fmcontent/branches/news/class/topic.php 2012-01-19 08:09:27 UTC (rev 8757) @@ -89,15 +89,14 @@ $criteria = new CriteriaCompo (); $criteria->add ( new Criteria ( 'topic_modid', $NewsModule->getVar ( 'mid' ) ) ); $topic = $topic_Handler->getObjects ( $criteria ); - $tree = new XoopsObjectTree ( $topic, 'topic_id', 'topic_pid' ); - ob_start (); - echo $tree->makeSelBox ( 'topic_pid', 'topic_title', '--', $this->getVar ( 'topic_pid', 'e' ), true ); - $form->addElement ( new XoopsFormLabel ( _NEWS_AM_TOPIC_PARENT, ob_get_contents () ) ); - ob_end_clean (); - - $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_TOPIC_DESC, "topic_desc", $this->getVar ( "topic_desc" ), 5, 47 ), false ); - //$form->addElement ( new XoopsFormText ( _NEWS_AM_TOPIC_WEIGHT, "topic_weight", 5, 11, $this->getVar ( "topic_weight" ) ), false ); - + if($topic) { + $tree = new XoopsObjectTree ( $topic, 'topic_id', 'topic_pid' ); + ob_start (); + echo $tree->makeSelBox ( 'topic_pid', 'topic_title', '--', $this->getVar ( 'topic_pid', 'e' ), true ); + $form->addElement ( new XoopsFormLabel ( _NEWS_AM_TOPIC_PARENT, ob_get_contents () ) ); + ob_end_clean (); + } + $form->addElement ( new XoopsFormTextArea ( _NEWS_AM_TOPIC_DESC, "topic_desc", $this->getVar ( "topic_desc" ), 8, 47 ), false ); // Image $topic_img = $this->getVar ( 'topic_img' ) ? $this->getVar ( 'topic_img' ) : 'blank.gif'; $uploadirectory_topic_img = xoops_getModuleOption ( 'img_dir', $NewsModule->getVar ( 'dirname' ) ); Modified: XoopsModules/fmcontent/branches/news/submit.php =================================================================== --- XoopsModules/fmcontent/branches/news/submit.php 2012-01-19 07:35:40 UTC (rev 8756) +++ XoopsModules/fmcontent/branches/news/submit.php 2012-01-19 08:09:27 UTC (rev 8757) @@ -100,7 +100,7 @@ } // file - if(isset($_REQUEST['file_name'])) { + if(isset($_FILES['file_name']['name']) && !empty($_FILES['file_name']['name'])) { $fileobj = $file_handler->create (); $fileobj->setVar ( 'file_date', time () ); $fileobj->setVar ( 'file_modid', $NewsModule->getVar ( 'mid' ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |