PageRenderTime 48ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/dynamic-widgets/mods/url_module.php

https://bitbucket.org/Thane2376/death-edge.ru
PHP | 60 lines | 48 code | 5 blank | 7 comment | 3 complexity | 5cc6afa349d936348c15d4e94ebad51c MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. /**
  3. * URL Module
  4. * Can't use DWOpts object because value = the serialized values
  5. *
  6. * @version $Id: date_module.php 437634 2011-09-13 19:19:13Z qurl $
  7. * @copyright 2011 Jacco Drabbe
  8. */
  9. class DW_URL extends DWModule {
  10. public static $option = array( 'url' => 'URL' );
  11. protected static $overrule = TRUE;
  12. protected static $type = 'custom';
  13. public static function admin() {
  14. $DW = $GLOBALS['DW'];
  15. parent::admin();
  16. $url_yes_selected = 'checked="checked"';
  17. $opt_url = $DW->getOpt($GLOBALS['widget_id'], 'url');
  18. $prefix = $DW->getURLPrefix();
  19. foreach ( $opt_url as $opt ) {
  20. if ( $opt->name == 'default' ) {
  21. $url_no_selected = $url_yes_selected;
  22. unset($url_yes_selected);
  23. } else {
  24. $urls = unserialize($opt->value);
  25. }
  26. }
  27. ?>
  28. <h4 id="url" title=" Click to toggle " class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"><b><?php _e('URL'); ?></b><?php echo ( count($opt_url) > 0 ) ? ' <img src="' . $DW->plugin_url . 'img/checkmark.gif" alt="Checkmark" />' : ''; ?></h4>
  29. <div id="url_conf" class="dynwid_conf ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom">
  30. <?php _e('Show widget at this URL?', DW_L10N_DOMAIN); ?> <img src="<?php echo $DW->plugin_url; ?>img/info.gif" alt="info" title="<?php _e('Click to toggle info', DW_L10N_DOMAIN) ?>" onclick="divToggle('url_info');" /><br />
  31. <?php $DW->dumpOpt($opt_url); ?>
  32. <div>
  33. <div id="url_info" class="infotext">
  34. Separate URLs on each line.<br />
  35. Use an asterisk ( * ) at the end of an URL as 'Starts with'.<br />
  36. Use an asterisk at the start of an URL as 'Ends with'.<br />
  37. Using an asterisk at the start and end of an url means 'Somewhere within'.<br />
  38. Without any asterisk means 'Exact match'.<br />
  39. When you don't start with an asterisk, start with a slash ( / ).<br />
  40. Beware of double rules! Especially when you set the default to 'No'. This means the widget will be shown NOWHERE.
  41. </div>
  42. </div>
  43. <br />
  44. <input type="radio" name="url" value="yes" id="url-yes" <?php echo ( isset($url_yes_selected) ) ? $url_yes_selected : ''; ?> /> <label for="url-yes"><?php _e('Yes'); ?></label>
  45. <input type="radio" name="url" value="no" id="url-no" <?php echo ( isset($url_no_selected) ) ? $url_no_selected : ''; ?> /> <label for="url-no"><?php _e('No'); ?></label><br />
  46. <?php _e('Except the URLs', DW_L10N_DOMAIN); ?>: <?php echo (! empty($prefix) ) ? '<br />Note: Do not include ' . $prefix : ''; ?><br />
  47. <div id="url-select" class="condition-select">
  48. <textarea name="url_value" style="width:300px;height:150px;"><?php echo ( isset($urls) ) ? implode("\n", $urls) : ''; ?></textarea>
  49. </div>
  50. </div><!-- end dynwid_conf -->
  51. <?php
  52. }
  53. }
  54. ?>