Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added MLP Pack string support

  • Loading branch information...
commit d18b20af0eb3078a0f3440217dfe44a6086f1332 1 parent fd6fd5f
Steve authored August 05, 2008

Showing 1 changed file with 53 additions and 2 deletions. Show diff stats Hide diff stats

  1. 55  aro_myadmin.php
55  aro_myadmin.php
@@ -11,6 +11,57 @@
11 11
 
12 12
 # --- BEGIN PLUGIN CODE ---
13 13
 
  14
+// MLP
  15
+global $aro_myadmin_strings;
  16
+if (!is_array($aro_myadmin_strings))
  17
+{
  18
+	$aro_myadmin_strings = array(
  19
+		'login_welcome' => 'Welcome <strong>{user}</strong>. If you are not {user}, <strong><a href="?logout=1">logout</a></strong> immediately.',
  20
+	);
  21
+}
  22
+
  23
+define( 'ARO_MYADMIN_PREFIX' , 'aro_myadmin' );
  24
+
  25
+register_callback( 'aro_myadmin_enumerate_strings' , 'l10n.enumerate_strings' );
  26
+function aro_myadmin_enumerate_strings($event , $step='' , $pre=0)
  27
+{
  28
+	global $aro_myadmin_strings;
  29
+	$r = array	(
  30
+				'owner'		=> 'aro_myadmin',
  31
+				'prefix'	=> ARO_MYADMIN_PREFIX,
  32
+				'lang'		=> 'en-gb',
  33
+				'event'		=> 'admin',
  34
+				'strings'	=> $aro_myadmin_strings,
  35
+				);
  36
+	return $r;
  37
+}
  38
+function aro_myadmin_gTxt($what,$args = array())
  39
+{
  40
+	global $aro_myadmin_strings, $textarray;
  41
+	
  42
+	$what = strtolower($what);
  43
+	$key = ARO_MYADMIN_PREFIX . '-' . $what;
  44
+
  45
+	if (isset($textarray[$key]))
  46
+	{
  47
+		$str = $textarray[$key];
  48
+	}
  49
+	else
  50
+	{
  51
+		if (isset($aro_myadmin_strings[$what]))
  52
+			$str = $aro_myadmin_strings[$what];
  53
+		elseif (isset($textarray[$what]))
  54
+			$str = $textarray[$what];
  55
+		else
  56
+			$str = $what;
  57
+	}
  58
+
  59
+	if( !empty($args) )
  60
+		$str = strtr( $str , $args );
  61
+
  62
+	return $str;
  63
+}
  64
+
14 65
 if (@txpinterface == 'admin'){
15 66
 	add_privs('aro_myadmin_js','1,2,3,4,5,6');
16 67
 	add_privs('dashboard','1,2,3,4,5,6');
@@ -39,7 +90,7 @@ function aro_dashboard() {
39 90
 	$prev = gps('prev');
40 91
 	$msg = '';
41 92
 	if( $prev === 'login' ) {
42  
-		$msg = "Welcome <strong>$txp_user</strong>. If you are not $txp_user, <strong><a href=\"?logout=1\">logout</a></strong> immediately.";
  93
+		$msg = aro_myadmin_gTxt('login_welcome',array('{user}'=>$txp_user));
43 94
 	}
44 95
 	echo pagetop('Textpattern' , $msg);
45 96
 
@@ -581,4 +632,4 @@ function aro_end_page($content){
581 632
 -->
582 633
 <?php
583 634
 }
584  
-?>
  635
+?>

0 notes on commit d18b20a

Please sign in to comment.
Something went wrong with that request. Please try again.