Changeset 904209
- Timestamp:
- 04/28/2014 04:35:35 PM (12 years ago)
- File:
-
- 1 edited
-
parsi-font/trunk/parsi-font.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
parsi-font/trunk/parsi-font.php
r904206 r904209 3 3 Plugin Name: WP-Parsi Admin Font Editor 4 4 Plugin URI: http://www.forum.wp-parsi.com/ 5 Description: Change Font Of Wordpress Dashboard.5 Description: Change fonts of wordpress. 6 6 Author: Ghaem 7 7 Version: 3.0 8 8 Tags: admin, admin font, html editor, visual editor, fonts, font, wordpress font, change font, parsi font, fonts, oersian, persian fonts, persian font 9 9 Author URI: http://www.forum.wp-parsi.com/ 10 Copyright: Ghaem Omidi - 201410 Copyright: Ghaem Omidi(WP-Parsi) 11 11 License: GPL 12 12 … … 16 16 Special thanks to : 17 17 Ariaieboy 18 Wordpress Parsi admins and moderators .18 Wordpress Parsi admins and moderators (Parsa Kafi, Mohsen Ghiasi, Saeed Fard, Abdolmajed Shahbakhsh, Morteza Rocky and Mostafa Soufi) 19 19 Wordpress Parsi forum members for great support(forum.wp-parsi.com) 20 20 */ … … 172 172 .wp-dialog, 173 173 .wp-dialog .ui-dialog-title, 174 .rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors,.rtl .wp_themeSkin .mceMenu .mceText,.rtl .wp-switch-editor,.rtl .quicktags-toolbar input,.rtl .clearlooks2 .mceTop span,.rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors, 174 175 .fade-trigger, 175 176 .wp-switch-editor switch-html, … … 199 200 text, 200 201 input[type="text"], 201 .wp_themeSkin .mceListBox a.mceText,202 202 code, 203 203 kbd,code, 204 204 .titlewrap input, 205 .rtl .media-frame input[type="text"],206 .rtl .media-frame .search,207 .rtl .media-frame input[type="search"],208 .rtl .media-frame select,209 .media-modal .media-sidebar .setting textarea,210 205 #TB_ajaxWindowTitle, 211 206 #sidemenu, … … 217 212 textarea.code, 218 213 html, 219 *,220 214 .html, 221 215 #html, 222 216 .wp_themeSkin table td, 223 #wp-content-editor-container,224 .wp_themeSkin *,225 .wp_themeSkin tr,226 217 #wp-link .toggle-arrow, 227 218 .rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors,.rtl .wp_themeSkin .mceMenu,.rtl .wp-switch-editor,.rtl .quicktags-toolbar input,.rtl .clearlooks2 .mceTop span,.rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors, … … 235 226 font-size: <?php echo $parsifont_font_size; ?>px; 236 227 <?php } ?> 237 } 238 .rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors,.rtl .wp-switch-editor,.rtl .quicktags-toolbar input,.rtl .clearlooks2 .mceTop span,.rtl .wp_themeSkin .mceColorSplitMenu a.mceMoreColors { 239 <?php 240 if ($parsifont_font_family) { ?> 241 font-family: <?php echo $parsifont_font_family; ?> !important; 242 <?php } 243 if ($parsifont_font_size) { ?> 244 font-size: <?php echo $parsifont_font_size; ?>px; 245 <?php } ?> 246 } 247 .bodyparsi { 248 <?php 249 if ($parsifont_font_family) { ?> 250 font-family: <?php echo $parsifont_font_family; ?>; 251 <?php } ?> 252 font-size:10pt; 253 color:#787878; 254 direction:rtl; 255 text-align:right; 256 margin:0 auto; 257 width:560px; 258 padding:0px; 259 background-color:#fff; 260 border-top-right-radius: 30px; 261 border-bottom-left-radius: 30px; 262 } 263 .error{ 264 width:400px; 265 border:1px #d3400d solid; 266 -webkit-border-radius: 5px; 267 -moz-border-radius: 5px; 268 padding:10px 10px 10px 10px; 269 <?php 270 if ($parsifont_font_family) { ?> 271 font-family: <?php echo $parsifont_font_family; ?>; 272 <?php } ?> 273 text-align: center !important; 274 display:block !important; 275 float:none !important; 276 margin-right:auto !important; 277 margin-left:auto !important; 278 background:yellow !important; 279 } 280 .ok{ 281 width:500px; 282 border:1px #a1cb45 solid; 283 -webkit-border-radius: 5px; 284 -moz-border-radius: 5px; 285 margin:5px 10px 10px 10px; 286 padding:10px 10px 10px 10px; 287 background:#eaf8cc; 288 display:block; 289 <?php 290 if ($parsifont_font_family) { ?> 291 font-family: <?php echo $parsifont_font_family; ?>; 292 <?php } ?> 293 text-align: center; 294 margin-left: auto; 295 margin-right: auto; 296 float: none; 297 } 298 #mainparsi{ 299 background-color:#ffffff; 300 <?php 301 if ($parsifont_font_family) { ?> 302 font-family: <?php echo $parsifont_font_family; ?>; 303 <?php } ?> 304 border: 4px dashed #F00; 305 border-top-right-radius: 30px; 306 border-bottom-left-radius: 30px; 307 } 308 .clear{clear:both} 309 form { 310 margin:0px; 311 padding:0px; 312 <?php 313 if ($parsifont_font_family) { ?> 314 font-family: <?php echo $parsifont_font_family; ?>; 315 <?php } ?> 316 } 317 input, select { 318 <?php 319 if ($parsifont_font_family) { ?> 320 font-family: <?php echo $parsifont_font_family; ?>; 321 <?php } ?> 322 padding:5px; 323 font-size:10pt; 324 border: 1px solid #cacaca; 325 -webkit-border-radius: 5px; 326 -moz-border-radius: 5px; 327 } 328 input[type="submit"]{ 329 <?php 330 if ($parsifont_font_family) { ?> 331 font-family: <?php echo $parsifont_font_family; ?>; 332 <?php } ?> 333 padding:5px; 334 font-size:11pt; 335 border: 1px solid #cacaca; 336 -webkit-border-radius: 5px; 337 -moz-border-radius: 5px; 338 } 339 .contentparsi { 340 -webkit-border-radius: 20px; 341 -moz-border-radius: 20px; 342 margin:50px 0 0 0; 343 padding:10px; 344 text-align: center; 345 <?php 346 if ($parsifont_font_family) { ?> 347 font-family: <?php echo $parsifont_font_family; ?>; 348 <?php } ?> 349 } 350 .formsparsi { 351 direction: rtl; 352 padding-right:20px; 353 text-align: right; 354 <?php 355 if ($parsifont_font_family) { ?> 356 font-family: <?php echo $parsifont_font_family; ?>; 357 <?php } ?> 358 } 359 .formsparsi h2 { 360 padding: 8px 2px; 361 border-bottom: 1px solid #CCC; 362 <?php 363 if ($parsifont_font_family) { ?> 364 font-family: <?php echo $parsifont_font_family; ?>; 365 <?php } ?> 366 } 367 .formsparsi label { 368 width: 100px; 369 text-align: center; 370 <?php 371 if ($parsifont_font_family) { ?> 372 font-family: <?php echo $parsifont_font_family; ?>; 373 <?php } ?> 374 display:block; 375 float:none; 376 margin-right:auto; 377 margin-left:auto; 378 } 379 .formsparsi .formparsi, .formsparsi .form-ltr { 380 width: 300px; 381 float: right; 382 padding: 2px; 383 <?php 384 if ($parsifont_font_family) { ?> 385 font-family: <?php echo $parsifont_font_family; ?>; 386 <?php } ?> 387 margin: 5px 0; 388 } 389 .formsparsi .form-ltr { 390 direction: ltr; 391 text-align: left; 392 <?php 393 if ($parsifont_font_family) { ?> 394 font-family: <?php echo $parsifont_font_family; ?>; 395 <?php } ?> 396 } 397 .formsparsi.text { 398 width: 250px; 399 height: 100px; 400 overflow: auto; 401 <?php 402 if ($parsifont_font_family) { ?> 403 font-family: <?php echo $parsifont_font_family; ?>; 404 <?php } ?> 405 } 406 .submitbot:hover { 407 <?php 408 if ($parsifont_font_family) { ?> 409 font-family: <?php echo $parsifont_font_family; ?>; 410 <?php } ?> 411 padding:5px; 412 font-size:11pt; 413 border: 1px solid #7613ae; 414 background:#7613ae; 415 color:#fff; 416 -webkit-border-radius: 5px; 417 -moz-border-radius: 5px; 418 } 419 .textare2:hover { 420 border: 1px solid #6295f3; 421 -webkit-border-radius: 5px; 422 -moz-border-radius: 5px; 423 <?php 424 if ($parsifont_font_family) { ?> 425 font-family: <?php echo $parsifont_font_family; ?>; 426 <?php } ?> 427 } 428 .textare2 { 429 width:500px; 430 } 431 .textare1:hover { 432 border: 1px solid #6295f3; 433 -webkit-border-radius: 5px; 434 -moz-border-radius: 5px; 435 <?php 436 if ($parsifont_font_family) { ?> 437 font-family: <?php echo $parsifont_font_family; ?>; 438 <?php } ?> 439 } 440 .textare1 { 441 width:500px; 442 <?php 443 if ($parsifont_font_family) { ?> 444 font-family: <?php echo $parsifont_font_family; ?>; 445 <?php } ?> 446 padding:5px; 447 font-size:10pt; 448 border: 1px solid #cacaca; 449 -webkit-border-radius: 5px; 450 -moz-border-radius: 5px; 451 } 228 } 452 229 </style> 453 230 … … 473 250 474 251 <div id="icon-options-general" class="icon32"><br></div> 475 <div style="margin-top:40px;font-size:50px;text-align:center;"><?php _e('Parsi Font', 'parsifont'); ?></div> 476 <br/> 477 <br/> 252 <?php echo '<h2>' . __('Parsi Font', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font') . '</h2>'; ?> 253 478 254 <?php 479 255 if( $_POST['parsifont-font-family'] || $_POST['parsifont-font-size'] ) { … … 493 269 494 270 <div id="setting-error-settings_updated" class="updated settings-error"> 495 <p><strong><?php _e('Settings saved.', 'parsifont' ); ?></strong></p></div>271 <p><strong><?php _e('Settings saved.', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></strong></p></div> 496 272 497 273 <?php … … 503 279 504 280 <tr valign="top"> 505 <th scope="row"><?php _e('Font Size (px)', 'parsifont' ); ?></th>281 <th scope="row"><?php _e('Font Size (px)', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></th> 506 282 <td> 507 283 508 284 <select name="parsifont-font-size" id="parsifont-font-size" style="width:290px;"> 509 <option value=""><?php _e('Select', 'parsifont' ); ?></option>285 <option value=""><?php _e('Select', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></option> 510 286 511 287 <?php … … 529 305 530 306 <tr valign="top"> 531 <th scope="row"><?php _e('Font Family', 'parsifont' ); ?></th>307 <th scope="row"><?php _e('Font Family', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></th> 532 308 <td> 533 309 534 310 535 311 <select name="parsifont-font-family" id="parsifont-font-family" style="width:290px;"> 536 <option value=""><?php _e('Select font from list or type a font name below', 'parsifont' ); ?></option>312 <option value=""><?php _e('Select font from list or type a font name below', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></option> 537 313 538 314 <?php … … 556 332 557 333 <br/> 558 <input type="text" placeholder="<?php _e('You can also type a font name here', 'parsifont' ); ?>" value="<?php if(!$using_preset) { echo $parsifont_font_family_user;} ?>" name="parsifont-font-family-user" id="parsifont-font-family-user" style="width:290px;">334 <input type="text" placeholder="<?php _e('You can also type a font name here', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?>" value="<?php if(!$using_preset) { echo $parsifont_font_family_user;} ?>" name="parsifont-font-family-user" id="parsifont-font-family-user" style="width:290px;"> 559 335 560 336 … … 564 340 565 341 <tr valign="top"> 566 <th scope="row" ><?php _e('Preview', 'parsifont'); ?></th>342 <th scope="row"><?php _e('Preview', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'); ?></th> 567 343 <td> 568 344 569 <textarea name="parsifont-preview" style="text-align:center;font-size:<?php echo $parsifont_font_size; ?>px; font-family:<?php echo $parsifont_font_family; ?>; width: 400px;height:90px;color:#000;" id="parsifont-preview" class="large-text code" disabled="disabled" spellcheck="false">This text is just to test.570 <?php _e('This text is just to test.', 'parsifont') ?></textarea>345 <textarea name="parsifont-preview" style="text-align:center;font-size:<?php echo $parsifont_font_size; ?>px; font-family:<?php echo $parsifont_font_family; ?>; width: 305px; height: 79px;color:#000;" id="parsifont-preview" class="large-text code" disabled="disabled" spellcheck="false">.این متن فقط برای آزمایش است 346 This text is just to test.</textarea> 571 347 572 348 </td> … … 577 353 578 354 <p class="submit"> 579 <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'parsifont' ) ?>" />355 <input type="submit" class="button-primary" value="<?php _e('Save Changes', 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font') ?>" /> 580 356 </p> 581 357 … … 583 359 </form> 584 360 585 <div style=" padding-top:8px;color:#666;text-align:center;background: none repeat scroll 0% 0% #F5F5DC;padding-bottom:50px;border-bottom-right-radius:44px;border-top-left-radius:44px;border:5px dashed;">586 < h3><b><?php _e('Plugin Features', 'parsifont') ?></b></h3>587 <ul >588 589 <li><strong> <?php _e('Beautiful dashboard by changing the font', 'parsifont') ?></strong></li>590 <li><strong> <?php _e('Change font Wordpress dashboard', 'parsifont') ?></strong></li>591 <li><strong> <?php _e('Select a font from the list of available fonts', 'parsifont') ?></strong></li>592 <li><strong> <?php _e('The user can write the name of the own favorite font.', 'parsifont') ?></strong></li>593 <li><strong> <?php _e('This plugin is developed by Ghaem Omidi.', 'parsifont') ?></strong></li>361 <div style="border-top: 1px solid #ccc; padding-top: 8px; color: #666;"> 362 <b><h3>ویژگی های افزونه</h3><b> 363 <ul style="list-style:inside"> 364 <li><strong>زیبا کردن پنل مدیریت با تغییر فونت</strong></li> 365 <li><strong>تغییر فونت ویرایشگر وردپرس</strong></li> 366 <li><strong>تغییر فونت پنل مدیریت وردپرس</strong></li> 367 <li><strong>انتخاب فونت از لیست موجود فونت ها</strong></li> 368 <li><strong>نوشتن نام فونت مورد نظر کاربر</strong></li> 369 <li><strong>این افزونه توسط قائم امیدی ساخته شده است.</strong></li> 594 370 </ul> 595 <div style="text-align:center;"><b><h3><?php _e('Dedicated to the all users of WP-Parsi and Mandegarweb.', 'parsifont') ?></h3></b></div> 596 597 <?php 598 session_start(); 599 if(isset($_POST['submit'])) { 600 if(!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['message']) && !empty($_POST['subject'])) { 601 if($_POST['code'] == $_SESSION['rand_code']) { 602 // send email 603 $accept = __('Your message was successfully sent. Thanks', 'parsifont'); 604 $to = "ghaemomidi@yahoo.com"; 605 $subject = $_POST['subject']; 606 $name= $_POST['name']; 607 $from = $_POST['email']; 608 $user_message = $_POST['message']; 609 $body = "\n". 610 "Name: $name\n". 611 "Email: $from \n". 612 "Message: \n ". 613 "$user_message\n". 614 $headers = "From: $from \r\n"; 615 $headers .= "Reply-To: $from \r\n"; 616 mail($to, $subject, $body, $headers); 617 } 618 } else { 619 $error = __('Please fill all fields.', 'parsifont'); 620 } 621 } 622 ?> 623 <div class="bodyparsi"> 624 <div id="mainparsi"> 625 <div class="contentparsi"> 626 <h2><?php _e('If you want your favorite font to be used in plugin or you have comments or suggestions please let us know via this form:', 'parsifont') ?></h2> 627 <?php if(!empty($error)) echo '<div class="error">'.$error.'</div>'; ?> 628 <?php if(!empty($accept)) echo '<div class="ok">'.$accept.'</div>'; ?> 629 <p> 630 <div class="formsparsi"> 631 <form action="" method="post"> 632 <label for="username"><?php _e('Name', 'parsifont') ?></label> 633 <br/> 634 <input class="textare2" type="text" class="formparsi" value="" name="name"> 635 <br/><br/> 636 <label for="email"><?php _e('Email', 'parsifont') ?></label> 637 <br/> 638 <input class="textare2" type="text" id="email" value="" class="form-ltr" name="email"> 639 <br/><br/> 640 <label for="sub"><?php _e('Subject', 'parsifont') ?></label> 641 <br/> 642 <input class="textare2" type="text" id="sub" value="" class="formparsi" name="subject"> 643 <br/><br/> 644 <label for="mess"><?php _e('Your Message', 'parsifont') ?></label> 645 <br/> 646 <textarea class="textare1" id="mess" rows="7" name="message"></textarea> 647 <br/><br/> 648 <input style="float:none !important;margin-right:auto;margin-left:auto;display:block;" class="submitbot" type="submit" name="submit" value="<?php _e('Send', 'parsifont') ?>"> 649 </form> 371 <div style="text-align:center;"><b><h3>تقدیم به تمامی کاربران وردپرس پارسی و ماندگار وب</h3><b></div> 650 372 </div> 651 </p> 373 652 374 </div> 653 <div class="clear"></div> 654 </div> 655 </div> 656 </div> 657 </div> 375 376 377 658 378 <script type="text/javascript"> 659 379 … … 690 410 691 411 function parsifont_create_menu() { 692 add_menu_page(__("Parsi Font", 'parsifont'), __("Parsi Font", 'parsifont'), 1, "parsifont-settings", "parsifont_settings_page"); 412 413 add_menu_page(__("Parsi Font", 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'), __("Parsi Font", 'parsifont', 'G:\\\\Web\\\\Wordpress\\\\Plugins\\\\parsi-font'), 1, "parsifont-settings", "parsifont_settings_page"); 414 693 415 } 694 416 695 417 add_action('admin_menu', 'parsifont_create_menu'); 418 419 function plugin_mce_css( $mce_css ) { 420 421 global $current_user; 422 get_currentuserinfo(); 423 424 $parsifont_font_size = get_user_meta($current_user->ID, 'parsifont-font-size', true); 425 $parsifont_font_family = get_user_meta($current_user->ID, 'parsifont-font-family', true); 426 427 if ( ! empty( $mce_css ) ) 428 $mce_css .= ','; 429 430 $mce_css .= plugins_url( 'css.php?size='.$parsifont_font_size.'&font='.$parsifont_font_family, __FILE__ ); 431 432 return $mce_css; 433 } 434 435 add_filter( 'mce_css', 'plugin_mce_css' ); 436 437 696 438 697 439 // for transalations
Note: See TracChangeset
for help on using the changeset viewer.