Changeset 846597
- Timestamp:
- 01/28/2014 01:29:03 AM (12 years ago)
- Location:
- progrids-widgets/trunk
- Files:
-
- 10 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (modified) (previous)
-
classes/ProGrids.php (modified) (2 diffs)
-
classes/ProGridsApi.php (modified) (2 diffs)
-
css/admin.css (modified) (2 diffs)
-
functions.php (modified) (3 diffs)
-
js/SelectedWidget.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
views/settings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
progrids-widgets/trunk/classes/ProGrids.php
r843274 r846597 72 72 add_menu_page('ProGrids.com Widget Settings', 'ProGrids', 'administrator', 'proGridsPlugin', array($this->controller, 'main'), PROGRIDS_PLUGIN_URL . '/images/proGrids.png'); 73 73 // if ($this->cache->isLoggedIn()) { 74 if ($this->options->isLoggedIn() ) {74 if ($this->options->isLoggedIn() && $this->options->widgetId() && $this->api->getWidget($this->options->widgetId()) ) { 75 75 add_submenu_page('proGridsPlugin', 'ProGrids Widgets', 'Widgets', 'administrator', 'proGridsWidgets', array($this->controller, 'settings')); 76 76 add_submenu_page('proGridsPlugin', 'ProGrids Reports', 'Reports', 'administrator', 'proGridsReports', array($this->controller, 'reports')); … … 78 78 add_submenu_page('proGridsPlugin', 'ProGrids Custom Ad', 'Custom Ad', 'administrator', 'proGridsCustomAd', array($this->controller, 'customAd')); 79 79 } else { 80 $this->api->logout(); 80 81 $page = isset($_GET['page']) ? $_GET['page'] : ''; 81 82 switch ($page) { -
progrids-widgets/trunk/classes/ProGridsApi.php
r842632 r846597 51 51 public function getWidget($widgetId) 52 52 { 53 return $this->request(PROGRIDS_BASE_URL . '/widget/' . $widgetId . '/getCode'); 53 $content = $this->request(PROGRIDS_BASE_URL . '/widget/' . $widgetId . '/getCode'); 54 $content = self::isProGridsLoginRedirect($content) ? '' : $content; 55 return $content; 54 56 } 55 57 … … 176 178 } 177 179 178 private static function isProGridsLoginRedirect($content = '' , $contentType = 'text/html')180 private static function isProGridsLoginRedirect($content = '') 179 181 { 180 $htmlStart = '<!DOCTYPE html>'; 181 return substr($content, 0, strlen($htmlStart)) == $htmlStart && preg_match('~text/html.*~', $contentType) && preg_match('~.*Log In.*~', $content); 182 return preg_match( '~^<!DOCTYPE html.*$~', $content ); 182 183 } 183 184 -
progrids-widgets/trunk/css/admin.css
r842537 r846597 163 163 } 164 164 165 # submit {165 #pg-submit { 166 166 margin-top: 25px; 167 167 padding: 0 10px; … … 412 412 } 413 413 414 # submit.noPointer {414 #pg-submit.noPointer { 415 415 cursor: default; 416 416 } -
progrids-widgets/trunk/functions.php
r842676 r846597 4 4 * Plugin Name: ProGrids Widget Plugin 5 5 * Description: ProGrids.com widget management plugin 6 * Version: 1.5. 56 * Version: 1.5.6 7 7 * Author: Sazze, Inc. 8 8 * Author URI: http://progrids.com/ … … 12 12 */ 13 13 14 if (!defined( PROGRIDS_DEV_ENVIRON)) {14 if (!defined('PROGRIDS_DEV_ENVIRON')) { 15 15 define('PROGRIDS_DEV_ENVIRON', file_exists(dirname(__FILE__) . '/development')); 16 16 } … … 21 21 define('PROGRIDS_PLUGIN_DIR', dirname(__FILE__)); 22 22 23 define('PROGRIDS_PLUGIN_URL', PROGRIDS_DEV_ENVIRON ? plugins_url('', 'progrids/functions.php') : (plugins_url() . '/' . basename(dirname(__FILE__)))); //|| preg_match('~.*current.*~', __FILE__)23 define('PROGRIDS_PLUGIN_URL', PROGRIDS_DEV_ENVIRON || preg_match('~.*current.*~', __FILE__) ? plugins_url('', 'progrids-widget/functions.php') : (plugins_url() . '/' . basename(dirname(__FILE__)))); // 24 24 25 25 define('PROGRIDS_VIEW_DIR', dirname(__FILE__) . '/views'); -
progrids-widgets/trunk/js/SelectedWidget.js
r842549 r846597 15 15 init: function() { 16 16 self.widgets = $('#widgets'); 17 self.saveButton = $('# submit');17 self.saveButton = $('#pg-submit'); 18 18 self.registerEvents(); 19 19 }, -
progrids-widgets/trunk/readme.txt
r843473 r846597 4 4 Requires at least: 3.2 5 5 Tested up to: 3.8 6 Stable tag: 1.5. 56 Stable tag: 1.5.6 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 58 58 4. Another ProGrids widget example on your blog!<br> 59 59 60 60 61 == Changelog == 61 62 -
progrids-widgets/trunk/views/settings.php
r842632 r846597 66 66 67 67 <div> 68 <input id=" submit" title="You must save these settings in order for your widget to be published." class="button button-primary noPointer" type="submit"68 <input id="pg-submit" title="You must save these settings in order for your widget to be published." class="button button-primary noPointer" type="submit" 69 69 value="<?php echo $shared->selectedWidget->STATUS_CURRENT; ?>" style="background: <?php echo $shared->selectedWidget->COLOR_CURRENT; ?>"> 70 70 </div>
Note: See TracChangeset
for help on using the changeset viewer.