Changeset 46457
- Timestamp:
- 05/17/08 09:51:41 (2 months ago)
- Location:
- chcounter-widget
- Files:
-
- 4 added
- 3 modified
-
tags/2.2.1/chcounter-tr_TR.mo (added)
-
tags/2.2.1/chcounter-tr_TR.po (added)
-
tags/2.2.1/readme.txt (modified) (1 diff)
-
trunk/chcounter-tr_TR.mo (added)
-
trunk/chcounter-tr_TR.po (added)
-
trunk/chcounter-widget.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
chcounter-widget/tags/2.2.1/readme.txt
r40797 r46457 26 26 The parameters to display are controlled via the admin panel. There's also an option to make chCounter invisible while active and counting. 27 27 28 **Translations** 29 30 * [Turkish](http://http://svn.wp-plugins.org/chcounter-widget/trunk/chcounter-tr_TR.mo) by Roman Neumüller 31 32 The Plugin supports by default English and German. All the other language files are also in trunk and will be automatically included in future releases. 28 33 29 34 == Installation == -
chcounter-widget/trunk/chcounter-widget.php
r40775 r46457 70 70 * @return array 71 71 */ 72 function get _parameters()72 function getParameters() 73 73 { 74 74 $params = array(); … … 100 100 101 101 $options = get_option( 'chcounter_widget' ); 102 $params = $this->get _parameters();102 $params = $this->getParameters(); 103 103 104 104 $defaults = array( … … 150 150 * @return void 151 151 */ 152 function display _admin_page()153 { 154 $params = $this->get _parameters();152 function displayAdminPage() 153 { 154 $params = $this->getParameters(); 155 155 $options = get_option( 'chcounter_widget' ); 156 156 157 if ( isset($_POST['update_chcounter']) ) {157 if ( isset($_POST['update_chcounter']) && check_admin_referer( 'chcounter-widget_update-options' ) ) { 158 158 if ( 'update_options' == $_POST['update_chcounter'] ) { 159 159 $options['chcounter_path'] = $_POST['chcounter_widget_path']; 160 160 $options['invisible'] = isset( $_POST['chcounter_widget_invisible'] ) ? 1 : 0; 161 $options['params']['available'] = $this->get _order($_POST['chcounter_widget_available_order'], 'chcounter_available');162 $options['params']['active'] = $this->get _order($_POST['chcounter_widget_active_order'], 'chcounter_active');161 $options['params']['available'] = $this->getOrder($_POST['chcounter_widget_available_order'], 'chcounter_available'); 162 $options['params']['active'] = $this->getOrder($_POST['chcounter_widget_active_order'], 'chcounter_active'); 163 163 164 164 update_option('chcounter_widget', $options); … … 173 173 174 174 <form action='options-general.php?page=chcounter-widget.php' method='post' onSubmit="populateHiddenVars();"> 175 175 176 <?php wp_nonce_field( 'chcounter-widget_update-options') ?> 177 176 178 <h3><?php _e( 'General Settings', 'chcounter' ) ?></h3> 177 179 <p><label for='chcounter_widget_path'><?php _e( 'chCounter Path', 'chcounter' ) ?>: </label><?php echo $_SERVER['DOCUMENT_ROOT'] ?><input type='text' name='chcounter_widget_path' id='chcounter_widget_path' value='<?php echo $options['chcounter_path'] ?>' size='20' /><?php _e( 'without trailing slash', 'chcounter' ) ?></p> … … 244 246 * @return array 245 247 */ 246 function get _order( $input, $listname )248 function getOrder( $input, $listname ) 247 249 { 248 250 parse_str( $input, $input_array ); … … 263 265 * @return void 264 266 */ 265 function widget_control()267 function control() 266 268 { 267 269 $options = get_option( 'chcounter_widget' ); … … 283 285 * @return void 284 286 */ 285 function register _widget()287 function register() 286 288 { 287 289 if ( !function_exists("register_sidebar_widget") ) … … 289 291 290 292 register_sidebar_widget( 'chCounter', array(&$this, 'display') ); 291 register_widget_control( 'chCounter', array(&$this, ' widget_control'), 250, 100 );293 register_widget_control( 'chCounter', array(&$this, 'control'), 250, 100 ); 292 294 return; 293 295 } … … 302 304 function init() 303 305 { 304 $params = $this->get _parameters();306 $params = $this->getParameters(); 305 307 306 308 $options = array(); … … 372 374 * @param none 373 375 */ 374 function add _header_code()376 function addHeaderCode() 375 377 { 376 378 echo "<link rel='stylesheet' href='".$this->plugin_url."/style.css' type='text/css' />\n"; … … 386 388 * @return void 387 389 */ 388 function add _admin_menu()389 { 390 $mypage = add_options_page( __( 'chCounter Widget', 'chcounter' ), __( 'chCounter Widget', 'chcounter' ), 8, basename(__FILE__), array(&$this, 'display _admin_page') );391 add_action( "admin_print_scripts-$mypage", array(&$this, 'add _header_code') );390 function addAdminMenu() 391 { 392 $mypage = add_options_page( __( 'chCounter Widget', 'chcounter' ), __( 'chCounter Widget', 'chcounter' ), 8, basename(__FILE__), array(&$this, 'displayAdminPage') ); 393 add_action( "admin_print_scripts-$mypage", array(&$this, 'addHeaderCode') ); 392 394 } 393 395 } … … 396 398 397 399 398 add_action( 'plugins_loaded', array(&$chcounter_widget, 'register _widget') );400 add_action( 'plugins_loaded', array(&$chcounter_widget, 'register') ); 399 401 add_action( 'activate_'.basename(__FILE__, ".php") .'/' . basename(__FILE__), array(&$chcounter_widget, 'init') ); 400 add_action( 'admin_menu', array(&$chcounter_widget, 'add _admin_menu') );402 add_action( 'admin_menu', array(&$chcounter_widget, 'addAdminMenu') ); 401 403 402 404 load_plugin_textdomain( 'chcounter', $path = PLUGINDIR.'/'.basename(__FILE__, ".php") ); 403 405 404 406 // Uninstall chCounter Widget 405 if ( isset( $_GET['chcounter-widget']) AND 'uninstall' == $_GET['chcounter-widget'] AND ( isset($_GET['delete_plugin']) AND1 == $_GET['delete_plugin'] ) )407 if (isset( $_GET['chcounter-widget']) && 'uninstall' == $_GET['chcounter-widget'] && ( isset($_GET['delete_plugin']) && 1 == $_GET['delete_plugin'] ) ) 406 408 $chcounter_widget->uninstall(); 407 409 -
chcounter-widget/trunk/readme.txt
r40797 r46457 26 26 The parameters to display are controlled via the admin panel. There's also an option to make chCounter invisible while active and counting. 27 27 28 **Translations** 29 30 * [Turkish](http://http://svn.wp-plugins.org/chcounter-widget/trunk/chcounter-tr_TR.mo) by Roman Neumüller 31 32 The Plugin supports by default English and German. All the other language files are also in trunk and will be automatically included in future releases. 28 33 29 34 == Installation ==
