-
-
- ".
- $frm->admin_button('dupfield', "Add Filter", 'action', '', array('other' => 'onclick="duplicateHTML(\'filterline\',\'srch_container\');"'))
- ." |
-
- ".$frm->filterType($field_columns)."".$frm->filterValue()."
- |
- ".
- $frm->admin_button('searchsubmit', NWSLAN_63, 'search')."
- |
-
-
-
+
+ ";
+ $text .= $frm->admin_button('searchsubmit', NWSLAN_63, 'search');
+ $text .= "
";
// --------------------------------------------
- if (varsettrue($_POST['searchquery']))
+ if (vartrue($_POST['searchquery']))
{
$query = "news_title REGEXP('".$_POST['searchquery']."') OR news_body REGEXP('".$_POST['searchquery']."') OR news_extended REGEXP('".$_POST['searchquery']."') ORDER BY news_datestamp DESC";
}
@@ -1101,16 +1107,21 @@ class admin_newspost
$text .= "
-
+ ";
+ $text .= "
".$this->show_batch_options()."
";
+ $text .= "
";
+
}
else
{
$text .= "
".isset($_POST['searchquery']) ? sprintf(NWSLAN_121, '
"'.$_POST['searchquery'])."" « ".LAN_BACK."" : NWSLAN_43."
";
}
+
+
$newsposts = $e107->sql->db_Count('news');
if (!varset($_POST['searchquery']))
@@ -1125,6 +1136,90 @@ class admin_newspost
$e107->ns->tablerender(NWSLAN_4, $emessage->render().$text);
}
+ function show_batch_options()
+ {
+ $e107 = e107::getInstance();
+ $classObj = $e107->getUserClass();
+ $frm = new e_form();
+ $classes = $classObj->uc_get_classlist();
+
+/*
+ $assignClasses = array(); // Userclass list of userclasses that can be assigned
+ foreach ($classes as $key => $val)
+ {
+ if ($classObj->isEditableClass($key))
+ {
+ $assignClasses[$key] = $classes[$key];
+ }
+ }
+ unset($assignClasses[0]);
+
+ $removeClasses = $assignClasses; // Userclass list of userclasses that can be removed
+ $removeClasses[0] = array('userclass_name'=>array('userclass_id'=>0, 'userclass_name'=>USRLAN_220));
+*/
+
+ $comments_array = array("Disable Comments","Allow Comments");
+
+
+ return $frm->batchoptions(
+ array(
+ 'delete_selected' => LAN_DELETE,
+ 'category' => array('Modify Category', $this->news_categories),
+ 'rendertype' => array('Modify Render-type', $this->news_renderTypes),
+ 'comments' => array('Modify Comments', $comments_array)
+ ),
+ array(
+ 'userclass' => array('Assign Visibility...',$classes),
+ )
+ );
+ }
+
+ function batch_category($ids,$value)
+ {
+ $sql = e107::getDb();
+ $count = $sql->db_Update("news","news_category = ".$value." WHERE news_id IN (".implode(",",$ids).") ");
+ }
+
+ function batch_comments($ids,$value)
+ {
+ $sql = e107::getDb();
+ $count = $sql->db_Update("news","news_allow_comments = ".$value." WHERE news_id IN (".implode(",",$ids).") ");
+ }
+
+ function batch_rendertype($ids,$value)
+ {
+ $sql = e107::getDb();
+ $count = $sql->db_Update("news","news_render_type = ".$value." WHERE news_id IN (".implode(",",$ids).") ");
+ }
+
+ function batch_userclass($ids,$value)
+ {
+ $sql = e107::getDb();
+ $count = $sql->db_Update("news","news_class = ".$value." WHERE news_id IN (".implode(",",$ids).") ");
+ }
+
+ function batch_delete($ids,$value)
+ {
+ $sql = e107::getDb();
+ $count = $sql->db_Delete("news","news_id IN (".implode(",",$ids).") ");
+ }
+
+
+
+
+ function process_batch($id_array)
+ {
+ list($type,$tmp,$value) = explode("_",$_POST['execute_batch']);
+ $method = "batch_".$type;
+
+ if (method_exists($this,$method) && isset($id_array) )
+ {
+ $this->$method($id_array,$value);
+ }
+ }
+
+
+
function _pre_create()
{
@@ -1525,15 +1620,10 @@ class admin_newspost
";
- $ren_type = array(NWSLAN_75,NWSLAN_76,NWSLAN_77,NWSLAN_77." 2");
- $r_array = array();
- foreach($ren_type as $key=>$value) {
- $r_array[$key] = $value;
- }
-
+
$text .= "
- ".$frm->radio_multi('news_rendertype', $r_array, $_POST['news_rendertype'], true)."
+ ".$frm->radio_multi('news_rendertype', $this->news_renderTypes, $_POST['news_rendertype'], true)."
".NWSLAN_74."
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index ff48e04b3..01dd463c3 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -9,9 +9,9 @@
* Form Handler
*
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
- * $Revision: 1.47 $
- * $Date: 2009-10-09 15:06:44 $
- * $Author: secretr $
+ * $Revision: 1.48 $
+ * $Date: 2009-10-20 07:39:40 $
+ * $Author: e107coders $
*
*/
@@ -247,8 +247,8 @@ class e_form
if($classnum == e_UC_BLANK)
return '';
- $tmp = explode(',', $current_value);
-
+ $tmp = explode(',', $current_value); //TODO add support for when $current_value is an array.
+
$class = $style = '';
if($nest_level == 0)
{
@@ -835,26 +835,40 @@ class e_form
|