diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index ef1f50fee..894457c52 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -188,7 +188,7 @@ class page_chapters_ui extends e_admin_ui 'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'writeParms'=>'size=xxlarge', 'readonly'=>FALSE), 'chapter_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE), - 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name + 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'batch'=>true, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name 'chapter_manager' => array('title'=> CUSLAN_55, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE), 'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ), 'chapter_visibility' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE), @@ -583,7 +583,7 @@ class page_admin_ui extends e_admin_ui 'page_rating_flag' => array('title'=> LAN_RATING, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ), 'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ), 'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)), - 'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'), + 'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'batch'=>true, 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'), 'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto'), 'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>'size=xxlarge'), diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 070390bd2..a38f61b08 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -440,7 +440,7 @@ class news_admin_ui extends e_admin_ui 'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'tags', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), 'news_meta_description' => array('title' => LAN_DESCRIPTION,'type' => 'textarea', 'data'=>'str', 'tab'=>1, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge')), - 'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')), + 'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'batch'=>1, 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')), 'news_ping' => array('title' => LAN_PING, 'type' => 'checkbox', 'tab'=>1, 'data'=>false, 'writeParms'=>'value=0', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), 'news_author' => array('title' => LAN_AUTHOR, 'type' => 'method', 'tab'=>0, 'readParms'=>'idField=user_id&nameField=user_name', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 3e704bb9c..bfc7fea18 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -3174,7 +3174,22 @@ class e_admin_controller_ui extends e_admin_controller switch($trigger[0]) { + case 'sefgen': + $field = $trigger[1]; + $value = $trigger[2]; + + //handleListBatch(); for custom handling of all field names + if(empty($selected)) return $this; + $method = 'handle'.$this->getRequest()->getActionName().'SefgenBatch'; + if(method_exists($this, $method)) // callback handling + { + $this->$method($selected, $field, $value); + } + break; + + case 'export': + if(empty($selected)) return $this; $method = 'handle'.$this->getRequest()->getActionName().'ExportBatch'; if(method_exists($this, $method)) // callback handling { @@ -4756,6 +4771,59 @@ class e_admin_ui extends e_admin_controller_ui } + /** + * Batch Export trigger + * @param array $selected + * @return void + */ + protected function handleListSefgenBatch($selected, $field, $value) + { + + $tree = $this->getTreeModel(); + $c= 0; + foreach($selected as $id) + { + if(!$tree->hasNode($id)) + { + e107::getMessage()->addError('Item #ID '.htmlspecialchars($id).' not found.'); + continue; + } + + $model = $tree->getNode($id); + + $name = $model->get($value); + + $sef = eHelper::title2sef($name,'dashl'); + + + + + + $model->set($field, $sef); + + + $model->save(); + + $data = $model->getData(); + + if($model->isModified()) + { + $this->getModel()->setData($data)->save(false,true); + $c++; + } + } + + + + $caption = e107::getParser()->lanVars(LAN_UI_BATCH_BOOL_SUCCESS, $c, true); + e107::getMessage()->addSuccess($caption); + + // e107::getMessage()->moveToSession(); + // redirect + // $this->redirect(); + } + + /** * Batch URL trigger @@ -5138,7 +5206,10 @@ class e_admin_ui extends e_admin_controller_ui { return; } - + + + + $cnt = $this->getTreeModel()->update($field, $val, $selected, true, false); if($cnt) { @@ -6287,7 +6358,8 @@ class e_admin_form_ui extends e_form 'copy' => $controller->getBatchCopy(), 'url' => $controller->getBatchLink(), 'featurebox' => $controller->getBatchFeaturebox(), - 'export' => $controller->getBatchExport() + 'export' => $controller->getBatchExport(), + ); @@ -6646,8 +6718,8 @@ class e_admin_form_ui extends e_form