Changeset 689936
- Timestamp:
- 04/01/2013 10:14:16 AM (13 years ago)
- Location:
- shortcodify/trunk
- Files:
-
- 4 added
- 4 edited
-
css (added)
-
css/shortcodify.css (added)
-
js (added)
-
js/shortcodify.js (added)
-
lang/shortcodify-de_DE.mo (modified) (previous)
-
lang/shortcodify-de_DE.po (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
-
shortcodify.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortcodify/trunk/lang/shortcodify-de_DE.po
r666057 r689936 9 9 "Content-Type: text/plain; charset=UTF-8\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 "PO-Revision-Date: 2013-02-1 1 00:24+0100\n"11 "PO-Revision-Date: 2013-02-10 22:26+0100\n" 12 12 "Last-Translator: Arne Lorenz <me@arnelorenz.de>\n" 13 13 "Language-Team: Arne Lorenz <me@arnelorenz.de>\n" … … 18 18 #: shortcodify.php:78 19 19 msgid "Bookmarks" 20 msgstr " Links"20 msgstr "" 21 21 22 22 #: shortcodify.php:196 23 23 msgid "Shortcodify Menu" 24 msgstr " Shortcodify Menü"24 msgstr "" 25 25 26 26 #: shortcodify.php:235 27 27 msgid "Add this widget to an other textfield with [widget]" 28 msgstr " Dieses Widget lässt sich mit [widget] an beliebiger Stelle einfügen."28 msgstr "" 29 29 30 30 #: shortcodify.php:301 shortcodify.php:342 … … 38 38 #: shortcodify.php:332 39 39 msgid "Whoops! There was a problem with the data you posted. Please try again." 40 msgstr " Ups, da gab es ein Problem beim Speichern. Tut mir leid"40 msgstr "" 41 41 42 42 #: shortcodify.php:339 … … 54 54 #: shortcodify.php:347 55 55 msgid "Create widget-shortcode" 56 msgstr " Erzeugt einen Widget-Shortcode"56 msgstr "" 57 57 58 58 #: shortcodify.php:350 59 59 msgid "Creates a widget-area for a shortcode. Use it with [widget] " 60 60 msgstr "" 61 "Erzeugt einen Widget-Bereich für einen Shortcode. Nutzbar über [widget]"62 61 63 62 #: shortcodify.php:353 … … 130 129 #. Plugin Name of the plugin/theme 131 130 msgid "Shortcodify" 132 msgstr " Shortcodify"131 msgstr "" 133 132 134 133 #. #-#-#-#-# plugin.pot (Shortcodify 1.0.0) #-#-#-#-# … … 137 136 #. Author URI of the plugin/theme 138 137 msgid "http://www.arnelorenz.de/" 139 msgstr " http://www.arnelorenz.de/"138 msgstr "" 140 139 141 140 #. Description of the plugin/theme … … 145 144 #. Author of the plugin/theme 146 145 msgid "Arne Lorenz" 147 msgstr " Arne Lorenz"146 msgstr "" -
shortcodify/trunk/readme.txt
r666069 r689936 31 31 * `[random] Text1 Text2 [/random]` - returns only one of included areas (seperated by linebreak or whatever) 32 32 * `[menu]` - adds a new menu to the nav-menus of WordPress. This shortcode inserts the content to the page for sitemaps or sitelist. 33 * `[accordion]` - adds a jQueryIU accordion to the page 34 * `[section]` - adds a section to the accordion. Use it inside the `[accordion]` shortcode. 33 35 * A few more useful shortcodes 34 36 … … 36 38 Please send me a request! 37 39 38 Version: trunk40 Version: 1.2.0 39 41 40 42 == Installation == … … 45 47 4. Use the shortcodes in tiny-field. 46 48 47 Version: trunk48 49 49 50 == Frequently asked questions == -
shortcodify/trunk/shortcodify.php
r666218 r689936 10 10 */ 11 11 /* 12 Version: TRUNK --> Set version number HERE12 Version: 1.3.0 13 13 14 14 Author URI: http://www.arnelorenz.de/ … … 25 25 * @var string The plugin version 26 26 */ 27 var $version = '1.0.0'; 28 var $version = 'TRUNK'; 27 var $version = '1.3.0'; 29 28 /** 30 29 * @var string The options string name for this plugin … … 139 138 $this->useMenus(); 140 139 } 141 } 142 143 //function wrap_shortcode_func($atts, $content= NULL) 144 140 141 // To use a accordion 142 if($this->options['sc_accordion']) 143 { 144 $this->useAccordion(); 145 } 146 } 147 148 /* 149 Function for small shortcode handling 150 instead of: function wrap_shortcode_func($atts, $content= NULL) 151 */ 145 152 public function __call($name, $argumente) { 153 // for calling the widget functions 154 if(substr($name, 0, 12) == 'createWidget'){ 155 $parts = explode('-', $name); 156 $name = $parts[0]; 157 $number = $parts[1]; 158 } 159 146 160 $atts = $argumente[0]; 147 161 $content = $argumente[1]; … … 172 186 case 'random': 173 187 if( isset( $atts['trennzeichen'] ) ) $trenner = $atts['trennzeichen']; 188 elseif( isset( $atts['separator'] ) ) $trenner = $atts['separator']; 174 189 else {$trenner = PHP_EOL;} 175 190 … … 178 193 $rtn = '<span class="wrap_shortcode random">'.do_shortcode( $content[ $rnd ] ).'</span>'; 179 194 break; 195 case 'createWidget': 196 $html = $this->getWidgetContent('Shortcodify '.$number); 197 return '<div class="shortcodify_widget sc_w'.$number.'">'.$html.'</div>'; 198 break; 180 199 default: 181 200 $rtn = $content; … … 187 206 add_action( 'widgets_init', array(&$this, 'shortcodify_widgets_init') ); 188 207 add_shortcode( 'widget', array(&$this, 'createWidget') ); 189 } 208 for ($i=1; $i<= $this->options['sc_widget_number']+1; $i++){ 209 // i dont know how to give this function-call an parameter :( 210 // so i use this _call method 211 add_shortcode( 'widget'.$i, array(&$this, 'createWidget-'.$i ) ); 212 } 213 } 214 215 function useAccordion(){ 216 //Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript 217 add_action( 'wp_enqueue_scripts', array(&$this,'loadCss') ); 218 add_action( 'wp_enqueue_scripts', array(&$this,'loadJs') ); 219 add_shortcode( 'accordion', array(&$this, 'createAccordion') ); 220 add_shortcode( 'section', array(&$this, 'createAccordionSection') ); 221 } 222 function loadJs() { 223 wp_enqueue_script('jquery'); 224 wp_enqueue_script('jquery-ui-accordion'); 225 wp_enqueue_script( 226 'shortcodify', 227 plugins_url('/js/shortcodify.js', __FILE__), 228 array('jquery'), 229 false, 230 true 231 ); 232 } 233 /** 234 * Enqueue plugin style-file 235 */ 236 function loadCss() { 237 // Respects SSL, Style.css is relative to the current file 238 // this css changes some font-sizes etc. :( 239 //wp_register_style( 'jquery-ui-default', 'http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css' ); 240 //wp_enqueue_style( 'jquery-ui-default' ); 241 // we use this 242 wp_register_style( 'shortcodify', plugins_url('css/shortcodify.css', __FILE__) ); 243 wp_enqueue_style( 'shortcodify' ); 244 } 190 245 191 246 function useMenus(){ … … 209 264 } 210 265 211 function createWidget( ) {212 $html = $this->getWidgetContent('Shortcodify ');213 return '<div class="shortcodify_widget ">'.$html.'</div>';266 function createWidget($number) { 267 $html = $this->getWidgetContent('Shortcodify '.$number); 268 return '<div class="shortcodify_widget sc_w'.$number.'">'.$html.'</div>'; 214 269 } 215 270 … … 224 279 } 225 280 226 //adds a widget Area 227 /** 228 * Register our sidebars and widgetized areas. 281 function createAccordion($atts, $content = NULL){ 282 //$atts['link'] 283 if(isset($atts['type'])) $name = $atts['type']; 284 else $name = 'no-auto'; 285 286 $ausgabe = trim($content); 287 //preg_match_all('/\[section\].*\[\/section\]/', $content, $ausgabe); 288 289 // remove whitespace at beginning 290 $ausgabe = preg_replace('/\A.*?\[section/s', '[section', $ausgabe); 291 // remove whitespace at end of sting 292 $ausgabe = preg_replace('/\A.*?\]noitces\/\[/s', ']noitces/[', strrev($ausgabe)); 293 $ausgabe = strrev($ausgabe); 294 // remove whitespace between tags 295 $ausgabe = preg_replace('/\[\/section\].*?\[section/s', '[/section][section', $ausgabe); 296 297 $rtn = '<div class="sc_accordion '.$name.'">'.do_shortcode( $ausgabe ).'</div>'; 298 return $rtn; 299 } 300 function createAccordionSection($atts, $content = NULL){ 301 $rtn = '<h3>'.$atts['name'].'</h3><div>'.do_shortcode($content).'</div>'; 302 return $rtn; 303 } 304 /** 305 * Adds a widget Area 229 306 * 230 307 */ 231 308 function shortcodify_widgets_init() 232 309 { 233 register_sidebar(array(310 $conf = array( 234 311 'name' => 'Shortcodify', 235 312 'id' => 'shortcodify', 236 'description' => __( 'Add this widget to an other textfield with [widget]' ),313 'description' => __( 'Add this widget to an other textfield with [widget]' , $this->localizationDomain), 237 314 'before_widget' => '<p class="shortcodify_widget">', 238 315 'after_widget' => '</p>', 239 316 'before_title' => '<h2>', 240 317 'after_title' => '</h2>', 241 ) ); 242 /* 243 register_sidebar( array( 244 'name' => 'disclaimer', 245 'id' => 'disclaimer', 246 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 247 'after_widget' => "</aside>", 248 'before_title' => '<h3 class="widget-title">', 249 'after_title' => '</h3>', 250 ) ); 251 */ 252 /* // add this to tmeplate 253 <?php if ( ! dynamic_sidebar( 'name' ) ) :?><?php endif;?> 254 */ 318 ); 319 register_sidebar( $conf ); 320 321 for ($i=1; $i<=$this->options['sc_widget_number']+1; $i++){ 322 $conf = array( 323 'name' => 'Shortcodify '.$i, 324 'id' => 'shortcodify'.$i, 325 'description' => __( 'Add this widget to an other textfield with [widget'.$i.']' , $this->localizationDomain), 326 'before_widget' => '<p class="shortcodify_widget sc_w'.$i.'">', 327 'after_widget' => '</p>', 328 'before_title' => '<h2>', 329 'after_title' => '</h2>', 330 ); 331 register_sidebar( $conf ); 332 } 255 333 } 256 334 … … 262 340 if (!$options = get_option($this->optionsName)) { 263 341 $options = array( 264 'sc_widget' => true 265 //'sc_menu' => true 342 'sc_widget' => true, 343 'sc_widget_number' => 0, 344 'sc_menu' => true, 345 'sc_accordion' => true 266 346 /* 267 347 'title' => 'Pages:', … … 313 393 if (wp_verify_nonce($_POST['_wpnonce'], 'wp-test-update-options')) { 314 394 $this->options['sc_widget'] = (isset($_POST['sc_widget']) && $_POST['sc_widget'] === 'on') ? true : false; 395 $this->options['sc_widget_number'] = (int)$_POST['sc_widget_number']; 396 315 397 $this->options['sc_menu'] = (isset($_POST['sc_menu']) && $_POST['sc_menu'] === 'on') ? true : false; 316 /* 398 $this->options['sc_accordion'] = (isset($_POST['sc_accordion']) && $_POST['sc_accordion'] === 'on') ? true : false; 399 /* 317 400 $this->options['title'] = $_POST['title']; 318 401 $this->options['previouspage'] = $_POST['previouspage']; … … 350 433 _e('Creates a widget-area for a shortcode. Use it with [widget]', $this->localizationDomain); ?></label></td> 351 434 </tr> 352 <tr valign="top" style="display: "> 435 <tr valign="top"> 436 <th scope="row"><?php _e('Number of widgets to create', $this->localizationDomain); ?></th> 437 <td> 438 <select name="sc_widget_number" id="sc_widget_number"> 439 <?php for ($i=0; $i<= 20; $i++) : ?> 440 <option value="<?php echo $i; ?>" <?php echo ($i == $this->options['sc_widget_number']) ? "selected='selected'" : ""; ?>><?php echo $i; ?></option> 441 <?php endfor; ?> 442 </select> 443 <span class="description"><?php _e('Select the number of widgets you want to create.', $this->localizationDomain); ?></span></td> 444 </tr> 445 <tr valign="top"> 353 446 <th scope="row"><?php _e('Create menu-shortcode', $this->localizationDomain); ?></th> 354 447 <td><label for="empty"> … … 356 449 _e('Creates a menu-area for a shortcode. Create a new menu e.g. for a sitemap. Use shortcode with [menu] ', $this->localizationDomain); ?></label></td> 357 450 </tr> 358 451 <tr valign="top"> 452 <th scope="row"><?php _e('Create accordion-shortcode', $this->localizationDomain); ?></th> 453 <td><label for="empty"> 454 <input type="checkbox" id="sc_accordion" name="sc_accordion" <?php echo ($this->options['sc_accordion'] === true) ? "checked='checked'" : ""; ?>/> <?php 455 _e('Creates a <a href="http://jqueryui.com/accordion/" target="_blank">accordion</a> shortcode. ', $this->localizationDomain); ?></label></td> 456 </tr> 457 458 <?php /* 359 459 <tr valign="top" style="display: none"> 360 <th scope="row"><?php _e('Before Markup:', $this->localizationDomain); ?></th> 361 <td><input name="before" type="text" id="before" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['before'])); ?>"/> 362 <span class="description"><?php _e('The HTML markup to display before the pagination code.', $this->localizationDomain); ?></span></td> 363 </tr> 364 <tr valign="top" style="display: none"> 365 <th scope="row"><?php _e('After Markup:', $this->localizationDomain); ?></th> 366 <td><input name="after" type="text" id="after" size="40" value="<?php echo stripslashes(htmlspecialchars($this->options['after'])); ?>"/> 367 <span class="description"><?php _e('The HTML markup to display after the pagination code.', $this->localizationDomain); ?></span></td> 368 </tr> 369 <tr valign="top" style="display: none"> 370 <th scope="row"><?php _e('WP-Paginate CSS File:', $this->localizationDomain); ?></th> 460 <th scope="row"><?php _e('...', $this->localizationDomain); ?></th> 371 461 <td><label for="css"> 372 462 <input type="checkbox" id="css" name="css" <?php echo ($this->options['css'] === true) ? "checked='checked'" : ""; ?>/> <?php printf(__('Include the default stylesheet wp-paginate.css? WP-Paginate will first look for <code>wp-paginate.css</code> in your theme directory (<code>themes/%s</code>).', $this->localizationDomain), get_template()); ?></label></td> 373 463 </tr> 374 464 <tr valign="top" style="display: none"> 375 <th scope="row"><?php _e(' Page Range:', $this->localizationDomain); ?></th>465 <th scope="row"><?php _e('...', $this->localizationDomain); ?></th> 376 466 <td> 377 467 <select name="range" id="range"> … … 380 470 <?php endfor; ?> 381 471 </select> 382 <span class="description"><?php _e(' The number of page links to show before and after the current page. Recommended value: 3', $this->localizationDomain); ?></span></td>472 <span class="description"><?php _e('...', $this->localizationDomain); ?></span></td> 383 473 </tr> 384 474 <tr valign="top" style="display: none"> 385 <th scope="row"><?php _e(' Page Anchors:', $this->localizationDomain); ?></th>475 <th scope="row"><?php _e('...', $this->localizationDomain); ?></th> 386 476 <td> 387 477 <select name="anchor" id="anchor"> … … 390 480 <?php endfor; ?> 391 481 </select> 392 <span class="description"><?php _e(' The number of links to always show at beginning and end of pagination. Recommended value: 1', $this->localizationDomain); ?></span></td>482 <span class="description"><?php _e('...', $this->localizationDomain); ?></span></td> 393 483 </tr> 394 484 <tr valign="top" style="display: none"> 395 <th scope="row"><?php _e(' Page Gap:', $this->localizationDomain); ?></th>485 <th scope="row"><?php _e('...', $this->localizationDomain); ?></th> 396 486 <td> 397 487 <select name="gap" id="gap"> … … 400 490 <?php endfor; ?> 401 491 </select> 402 <span class="description"><?php _e('The minimum number of pages in a gap before an ellipsis (...) is added. Recommended value: 3', $this->localizationDomain); ?></span></td> 403 </tr> 492 <span class="description"><?php _e('', $this->localizationDomain); ?></span></td> 493 </tr> 494 */?> 404 495 </table> 405 496 <p class="submit"> 406 <input type="submit" value="<?php _e('Save Changes' ); ?>" name="wp_test_save" class="button-primary" />497 <input type="submit" value="<?php _e('Save Changes', $this->localizationDomain); ?>" name="wp_test_save" class="button-primary" /> 407 498 </p> 408 499 </form> … … 420 511 function ShortcodifyWidget() { 421 512 // Instantiate the parent object 422 parent::__construct( false, ' My NewWidget Title' );513 parent::__construct( false, 'The Widget Title' ); 423 514 } 424 515
Note: See TracChangeset
for help on using the changeset viewer.