mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 13:11:52 +02:00
Fixes #1474 - check for page_title or menu_name during custom page/menu creation.
This commit is contained in:
parent
9717990572
commit
02a5cf6e81
@ -680,7 +680,7 @@ class page_admin_ui extends e_admin_ui
|
||||
function beforeCreate($newdata,$olddata)
|
||||
{
|
||||
$newdata['menu_name'] = preg_replace('/[^\w-*]/','-',$newdata['menu_name']);
|
||||
|
||||
|
||||
if(empty($newdata['page_sef']))
|
||||
{
|
||||
if(!empty($newdata['page_title']))
|
||||
@ -693,13 +693,20 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$newdata['page_sef'] = eHelper::secureSef($newdata['page_sef']);
|
||||
}
|
||||
|
||||
|
||||
$sef = e107::getParser()->toDB($newdata['page_sef']);
|
||||
|
||||
|
||||
if(isset($newdata['page_title']) && isset($newdata['page_title']) && empty($newdata['page_title']) && empty($newdata['menu_name']))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_79);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(e107::getDb()->count('page', '(*)', "page_sef='{$sef}'"))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_57);
|
||||
|
@ -2423,7 +2423,7 @@ class e107
|
||||
* @param boolean $merge
|
||||
* @return array
|
||||
*/
|
||||
public function getTemplateInfo($plug_name = null, $id, $key = null, $override = true, $merge = false)
|
||||
public static function getTemplateInfo($plug_name = null, $id, $key = null, $override = true, $merge = false)
|
||||
{
|
||||
if($plug_name)
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ define("CUSLAN_53", "Book or Chapter Title");
|
||||
|
||||
define("CUSLAN_55", "Can be edited by");
|
||||
define("CUSLAN_56", "Parent");
|
||||
define("CUSLAN_57", "Please choose unique SEF URL string for this entry.");
|
||||
define("CUSLAN_57", "Please choose a unique SEF URL for this entry.");
|
||||
define("CUSLAN_58", "View Pages in this chapter");
|
||||
define("CUSLAN_59", "Page");
|
||||
define("CUSLAN_60", "Page Options");
|
||||
@ -43,6 +43,8 @@ define("CUSLAN_75", "Missing Menu-id detected:");
|
||||
define("CUSLAN_76", "Menu with path #");
|
||||
define("CUSLAN_77", "deleted");
|
||||
define("CUSLAN_78", "Couldn't delete menu with path ");
|
||||
define("CUSLAN_79", "You must enter either a page title or a menu name.");
|
||||
|
||||
|
||||
// define("CUSLAN_54", "Meta Keywords"); //LAN_KEYWORDS
|
||||
// define("CUSLAN_1", "Title");
|
||||
|
Loading…
x
Reference in New Issue
Block a user