Changeset 946612
- Timestamp:
- 07/10/2014 11:01:37 PM (12 years ago)
- Location:
- bitid-authentication/trunk
- Files:
-
- 2 edited
-
ajax.php (modified) (5 diffs)
-
bitid-authentication.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bitid-authentication/trunk/ajax.php
r946553 r946612 19 19 { 20 20 $data['status'] = -1; 21 $data['html'] = "<p> Error: The current session dosn't have a bitid-nonce.</p>";21 $data['html'] = "<p>" . __("Error: The current session dosn't have a bitid-nonce.", 'bitid-authentication') . "</p>"; 22 22 } 23 23 else if($nonce_row['address']) … … 32 32 if(is_user_logged_in()) 33 33 { 34 $data['html'] = "<p> Allredy logged in</p>";34 $data['html'] = "<p>" . __("Allredy logged in", 'bitid-authentication') . "</p>"; 35 35 $data['reload'] = 1; 36 36 } … … 44 44 do_action('wp_login', $user->user_login, $user); 45 45 46 $data['html'] = "<p> Sucess, loged in as '{$user->user_login}'</p>";46 $data['html'] = "<p>" . sprintf(__("Sucess, loged in as '%s'", 'bitid-authentication'), $user->user_login) . "</p>"; 47 47 $data['reload'] = 1; 48 48 … … 52 52 else 53 53 { 54 $data['html'] = "<p> Bitid verification Sucess, but no useraccount connected to '{$data['adress']}'</p>";54 $data['html'] = "<p>" . sprintf(__("Bitid verification Sucess, but no useraccount connected to '%s'", 'bitid-authentication'), $data['adress']) . "</p>"; 55 55 } 56 56 } … … 58 58 else 59 59 { 60 $data['html'] = "<p> Bitid verification Sucess, but no useraccount connected to '{$data['adress']}'</p>";60 $data['html'] = "<p>" . sprintf(__("Bitid verification Sucess, but no useraccount connected to '%s'", 'bitid-authentication'), $data['adress']) . "</p>"; 61 61 } 62 62 } -
bitid-authentication/trunk/bitid-authentication.php
r946553 r946612 11 11 Author: Puggan 12 12 Author URI: http://blog.puggan.se 13 Text Domain: bitid-authentication 13 14 */ 14 15 15 DEFINE("BITID_AUTHENTICATION_PLUGIN_VERSION", '0.0. 4');16 DEFINE("BITID_AUTHENTICATION_PLUGIN_VERSION", '0.0.3a'); 16 17 17 18 require_once("bitid.php"); … … 75 76 address VARCHAR(34) COLLATE utf8_bin DEFAULT NULL, 76 77 birth DATETIME NOT NULL, 77 pulse DATETIME DEFAULT NULL,78 pulse DATETIME NOT NULL, 78 79 PRIMARY KEY (address), 79 80 KEY (user_id), … … 96 97 { 97 98 // add_options_page( 'Bitid Options', 'Bitid', 'edit_users', 'bitid-authentication', 'bitid_option_page' ); 98 add_users_page( 'My Bitid' , 'Bitid', 'read', 'my-bitid', 'bitid_my_option_page' ); 99 add_users_page( 100 _x('My Bitid', 'page_title', 'bitid-authentication'), 101 _x('Bitid', 'menu_name', 'bitid-authentication'), 102 'read', 103 'my-bitid', 104 'bitid_my_option_page' 105 ); 99 106 } 100 107 … … 148 155 if($db_result) 149 156 { 150 echo bitid_admin_notice( "The address '{$address}' is now linked to your account.");157 echo bitid_admin_notice(sprintf(__("The address '%s' is now linked to your account.", 'bitid-authentication'), $address)); 151 158 152 159 $addresses = bitid_list_users_addresses($user_id); … … 154 161 else 155 162 { 156 echo bitid_admin_notice( "Failed to link address '{$default_address}' to your account.", 'error');163 echo bitid_admin_notice(sprintf(__("Failed to link address '%s' to your account.", 'bitid-authentication'), $address), 'error'); 157 164 } 158 165 } 159 166 else 160 167 { 161 echo bitid_admin_notice( "The address '{$default_address}' isn't valid.", 'error');168 echo bitid_admin_notice(sprintf(__("The address '%s' isn't valid.", 'bitid-authentication'), $address), 'error'); 162 169 } 163 170 } … … 166 173 $default_address = (string) @$_REQUEST['address']; 167 174 } 175 176 $legend_title = _x("Add bitid-address", 'legend_title', 'bitid-authentication'); 177 $label_title = _x("Bitid-address", 'input_label', 'bitid-authentication'); 178 $button_title = _x("Link to my account", 'button', 'bitid-authentication'); 168 179 169 180 echo <<<HTML_BLOCK … … 171 182 <fieldset style='border: solid black 2px; width: 40em; padding: 10px; margin: 10px;'> 172 183 <legend style='font-size: larger;'> 173 Add bitid-address184 {$legend_title} 174 185 </legend> 175 186 <div class='fieldset_content'> 176 187 <label> 177 188 <span style='width: 10em; display: inline-block;'> 178 Bitid-address:189 {$label_title}: 179 190 </span> 180 191 <input type='text' name='address' value='{$default_address}' style='width: 25em;'/> 181 192 </label> 182 193 <br /> 183 <input type='submit' value=' Link to my account' style='margin-left: 10em;' />194 <input type='submit' value='{$button_title}' style='margin-left: 10em;' /> 184 195 </div> 185 196 </fieldset> … … 214 225 if($_POST) 215 226 { 216 echo bitid_admin_notice( "Select some rows before asking to delete them", 'error');227 echo bitid_admin_notice(__("Select some rows before asking to delete them", 'bitid-authentication'), 'error'); 217 228 break; 218 229 } 219 230 else 220 231 { 221 echo bitid_admin_notice( "Missing paramater 'address'", 'error');232 echo bitid_admin_notice(sprintf(__("Missing paramater '%s'", 'bitid-authentication'), 'address'), 'error'); 222 233 break; 223 234 } … … 241 252 if($found_addresses) 242 253 { 243 echo bitid_admin_notice("The address '" . implode("', '", $found_addresses) . "' isn't connected to your account.", 'error'); 254 echo bitid_admin_notice( 255 sprintf( 256 _n( 257 "The address %s isn't connected to your account.", 258 "Those addresses %s arn't connected to your account.", 259 count($found_addresses), 260 'bitid-authentication' 261 ), 262 "'" . implode("', '", $found_addresses) . "'" 263 ), 264 'error' 265 ); 244 266 } 245 267 … … 267 289 if($failed_addresses) 268 290 { 269 echo bitid_admin_notice("Failed to remove the adress '" . implode("', '", $failed_addresses) . "'", 'error'); 291 echo bitid_admin_notice( 292 sprintf( 293 _n( 294 "Failed to remove the adress %s.", 295 "Failed to remove those addresses %s.", 296 count($failed_addresses), 297 'bitid-authentication' 298 ), 299 "'" . implode("', '", $failed_addresses) . "'" 300 ), 301 'error' 302 ); 270 303 } 271 304 272 305 if($deleted_addresses) 273 306 { 274 $deleted_addresses_string = "'" . implode("', '", $deleted_addresses) . "'"; 275 276 echo bitid_admin_notice("The address '{$deleted_addresses_string}' is no longer linked to your account."); 307 echo bitid_admin_notice( 308 sprintf( 309 _n( 310 "The address %s is no longer linked to your account.", 311 "Those addresses %s is no longer linked to your account.", 312 count($deleted_addresses), 313 'bitid-authentication' 314 ), 315 "'" . implode("', '", $deleted_addresses) . "'" 316 ), 317 'error' 318 ); 277 319 278 320 $addresses = bitid_list_users_addresses($user_id); … … 289 331 } 290 332 333 $page_title = _x("My bitid-addresses", "page_title", 'bitid-authentication'); 334 $add_link_title = __("Add New"); 335 291 336 echo <<<HTML_BLOCK 292 337 <div class="wrap"> 293 338 <h2> 294 <span> My bitid-addresses</span>295 <a class="add-new-h2" href="?page={$_REQUEST['page']}&action=add"> Add New</a>339 <span>{$page_title}</span> 340 <a class="add-new-h2" href="?page={$_REQUEST['page']}&action=add">{$add_link_title}</a> 296 341 </h2> 297 342 298 343 HTML_BLOCK; 344 299 345 if(!$addresses) 300 346 { 301 echo bitid_admin_notice( "You have no bitid-addresses connected to your account.");347 echo bitid_admin_notice(__("You have no bitid-addresses connected to your account.", 'bitid-authentication')); 302 348 return; 303 349 } … … 309 355 return array( 310 356 'cb' => '<input type="checkbox" />', 311 'address' => 'Bitid-address',312 'birth' => 'Added',313 'pulse' => 'Last time used',357 'address' => _x('Bitid-address', 'column_name', 'bitid-authentication'), 358 'birth' => _x('Added', 'column_name', 'bitid-authentication'), 359 'pulse' => _x('Last time used', 'column_name', 'bitid-authentication'), 314 360 ); 315 361 } … … 355 401 $action_template = '<a href="?page=%s&action=%s&address=%s">%s</a>'; 356 402 $actions = array( 357 'edit' => sprintf($action_template, $_REQUEST['page'], 'edit', $item['address'], 'Edit'),358 'delete' => sprintf($action_template, $_REQUEST['page'], 'delete', $item['address'], 'Remove'),403 'edit' => sprintf($action_template, $_REQUEST['page'], 'edit', $item['address'], __('Edit')), 404 'delete' => sprintf($action_template, $_REQUEST['page'], 'delete', $item['address'], __('Remove')), 359 405 ); 360 406 return $item['address'] . $this->row_actions($actions); … … 364 410 { 365 411 return array( 366 'delete' => 'Delete',412 'delete' => __('Delete'), 367 413 ); 368 414 } … … 462 508 } 463 509 510 $title = _x("BitID login", 'qr_image_label', 'bitid-authentication'); 511 $alt_text = htmlentities(_x("QR-code for BitID", 'qr_alt_text', 'bitid-authentication'), ENT_QUOTES); 512 464 513 $url_encoded_url = urlencode($url); 465 514 $messages .= <<<HTML_BLOCK 466 515 <div id='bitid'> 467 516 <p> 468 <span> BITID login:</span>517 <span>{$title}:</span> 469 518 <a href='{$url}'> 470 <img src='https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl={$url_encoded_url}' />519 <img src='https://chart.googleapis.com/chart?cht=qr&chs=300x300&chl={$url_encoded_url}' alt='{$alt_text}' title='{$alt_text}' /> 471 520 </a> 472 521 </p>
Note: See TracChangeset
for help on using the changeset viewer.