Revision 1707
Added by Dietmar about 12 years ago
add.php | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* @category admin |
5 | 5 |
* @package pages |
6 |
* @author WebsiteBaker Project |
|
7 |
* @copyright 2004-2009, Ryan Djurovich |
|
8 |
* @copyright 2009-2011, Website Baker Org. e.V. |
|
6 |
* @author Ryan Djurovich, WebsiteBaker Project |
|
7 |
* @copyright 2009-2012, WebsiteBaker Org. e.V. |
|
9 | 8 |
* @link http://www.websitebaker2.org/ |
10 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
11 | 10 |
* @platform WebsiteBaker 2.8.x |
... | ... | |
53 | 52 |
if ($parent!=0) { |
54 | 53 |
if (!$admin->get_page_permission($parent,'admin')) |
55 | 54 |
{ |
56 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
55 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
57 | 56 |
} |
58 | 57 |
|
59 | 58 |
} elseif (!$admin->get_permission('pages_add_l0','system')) |
60 | 59 |
{ |
61 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
62 |
}
|
|
60 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
61 |
} |
|
63 | 62 |
|
64 | 63 |
// check module permissions: |
65 | 64 |
if (!$admin->get_permission($module, 'module')) |
66 | 65 |
{ |
67 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
68 |
}
|
|
66 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
67 |
} |
|
69 | 68 |
|
70 | 69 |
// Validate data |
71 | 70 |
if($title == '' || substr($title,0,1)=='.') |
72 | 71 |
{ |
73 |
$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']);
|
|
72 |
$admin->print_error($MESSAGE['PAGES_BLANK_PAGE_TITLE']);
|
|
74 | 73 |
} |
75 | 74 |
|
76 | 75 |
// Check to see if page created has needed permissions |
... | ... | |
82 | 81 |
if (in_array($adm_group, $admin->get_groups_id())) |
83 | 82 |
{ |
84 | 83 |
$admin_perm_ok = true; |
85 |
}
|
|
84 |
} |
|
86 | 85 |
} |
87 | 86 |
if ($admin_perm_ok == false) |
88 | 87 |
{ |
89 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
88 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
90 | 89 |
} |
91 | 90 |
$admin_perm_ok = false; |
92 | 91 |
foreach ($viewing_groups as $view_group) |
... | ... | |
98 | 97 |
} |
99 | 98 |
if ($admin_perm_ok == false) |
100 | 99 |
{ |
101 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
|
100 |
$admin->print_error($MESSAGE['PAGES_INSUFFICIENT_PERMISSIONS']);
|
|
102 | 101 |
} |
103 | 102 |
} |
104 | 103 |
|
... | ... | |
134 | 133 |
$get_same_page = $database->query("SELECT page_id FROM ".TABLE_PREFIX."pages WHERE link = '$link'"); |
135 | 134 |
if($get_same_page->numRows() > 0 OR file_exists(WB_PATH.PAGES_DIRECTORY.$link.PAGE_EXTENSION) OR file_exists(WB_PATH.PAGES_DIRECTORY.$link.'/')) |
136 | 135 |
{ |
137 |
$admin->print_error($MESSAGE['PAGES']['PAGE_EXISTS']);
|
|
136 |
$admin->print_error($MESSAGE['PAGES_PAGE_EXISTS']);
|
|
138 | 137 |
} |
139 | 138 |
|
140 | 139 |
// Include the ordering class |
... | ... | |
238 | 237 |
if($database->is_error()) { |
239 | 238 |
$admin->print_error($database->get_error()); |
240 | 239 |
} else { |
241 |
$admin->print_success($MESSAGE['PAGES']['ADDED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
|
|
240 |
$admin->print_success($MESSAGE['PAGES_ADDED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id);
|
|
242 | 241 |
} |
243 | 242 |
|
244 | 243 |
// Print admin footer |
Also available in: Unified diff
! update folder admin/pages, admin/skel/htt
! change multi-dimensional arrays (variables) to similar arrays
! change default templates, change code to new templates