' . $lang->get('editor_preview_blurb') . '
';
$text = RenderMan::render(RenderMan::preprocess_text($text, false, false));
ob_start();
eval('?>' . $text);
@@ -1817,8 +1873,9 @@
function pagediff($page_id, $namespace, $id1, $id2)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
if(!$session->get_permissions('history_view'))
- return 'Access denied';
+ return $lang->get('etc_access_denied');
if(!preg_match('#^([0-9]+)$#', (string)$id1) ||
!preg_match('#^([0-9]+)$#', (string)$id2 )) return 'SQL injection attempt';
// OK we made it through security
@@ -1835,7 +1892,7 @@
$time1 = date('F d, Y h:i a', $id1);
$time2 = date('F d, Y h:i a', $id2);
$_ob = "
-
Comparing revisions: {$time1} → {$time2}
+
" . $lang->get('history_lbl_comparingrevisions') . " {$time1} → {$time2}
";
// Free some memory
unset($row1, $row2, $q1, $q2);
@@ -1846,8 +1903,6 @@
/**
* Gets ACL information about the selected page for target type X and target ID Y.
- * @param string $page_id The page ID
- * @param string $namespace The namespace
* @param array $parms What to select. This is an array purely for JSON compatibility. It should be an associative array with keys target_type and target_id.
* @return array
*/
@@ -1855,11 +1910,13 @@
function acl_editor($parms = Array())
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
+
if(!$session->get_permissions('edit_acl') && $session->user_level < USER_LEVEL_ADMIN)
{
return Array(
'mode' => 'error',
- 'error' => 'You are not authorized to view or edit access control lists.'
+ 'error' => $lang->get('acl_err_access_denied')
);
}
$parms['page_id'] = ( isset($parms['page_id']) ) ? $parms['page_id'] : false;
@@ -1877,7 +1934,7 @@
{
return Array(
'mode' => 'error',
- 'error' => 'It seems that (a) the file acledit.tpl is missing from these theme, and (b) the JSON response is working.',
+ 'error' => $lang->get('acl_err_missing_template'),
);
}
$return['template'] = $template->extract_vars('acledit.tpl');
@@ -1938,7 +1995,7 @@
if(!$q)
return(Array('mode'=>'error','error'=>mysql_error()));
if($db->numrows() < 1)
- return Array('mode'=>'error','error'=>'The username you entered was not found.');
+ return Array('mode'=>'error','error'=>$lang->get('acl_err_user_not_found'));
$row = $db->fetchrow();
$return['target_name'] = $return['target_id'];
$return['target_id'] = intval($row['user_id']);
@@ -1985,7 +2042,7 @@
if(!$q)
return(Array('mode'=>'error','error'=>mysql_error()));
if($db->numrows() < 1)
- return Array('mode'=>'error','error'=>'The group ID you submitted is not valid.');
+ return Array('mode'=>'error','error'=>$lang->get('acl_err_bad_group_id'));
$row = $db->fetchrow();
$return['target_name'] = $row['group_name'];
$return['target_id'] = intval($row['group_id']);
@@ -2027,7 +2084,7 @@
case 'save_edit':
if ( defined('ENANO_DEMO_MODE') )
{
- return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.');
+ return Array('mode'=>'error','error'=>$lang->get('acl_err_demo'));
}
$q = $db->sql_query('DELETE FROM ' . table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).'
' . $page_where_clause_lite . ';');
@@ -2038,7 +2095,7 @@
{
return array(
'mode' => 'error',
- 'error' => 'Supplied rule list has a length of zero'
+ 'error' => $lang->get('acl_err_zero_list')
);
}
$q = ($page_id && $namespace) ? 'INSERT INTO ' . table_prefix.'acl ( target_type, target_id, page_id, namespace, rules )
@@ -2058,7 +2115,7 @@
case 'delete':
if ( defined('ENANO_DEMO_MODE') )
{
- return Array('mode'=>'error','error'=>'Editing access control lists is disabled in the administration demo.');
+ return Array('mode'=>'error','error'=>$lang->get('acl_err_demo'));
}
$q = $db->sql_query('DELETE FROM ' . table_prefix.'acl WHERE target_type='.intval($parms['target_type']).' AND target_id='.intval($parms['target_id']).'
' . $page_where_clause_lite . ';');
@@ -2105,6 +2162,7 @@
function aclmanager($parms)
{
global $db, $session, $paths, $template, $plugins; // Common objects
+ global $lang;
ob_start();
// Convenience
$formstart = '