Changeset 1148584
- Timestamp:
- 04/29/2015 01:42:46 AM (11 years ago)
- Location:
- genoo/trunk
- Files:
-
- 1 added
- 10 edited
-
Genoo.php (modified) (1 diff)
-
GenooInit.php (modified) (1 diff)
-
assets/GenooEditPost.js (modified) (2 diffs)
-
libs/Genoo/Admin.php (modified) (2 diffs)
-
libs/Genoo/Table.php (modified) (1 diff)
-
libs/Genoo/TableForms.php (modified) (1 diff)
-
libs/Genoo/Wordpress/Post.php (modified) (1 diff)
-
libs/Genoo/Wordpress/Settings.php (modified) (3 diffs)
-
libs/Genoo/Wordpress/Utils.php (modified) (1 diff)
-
libs/Genoo/Wordpress/WPListTable.php (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1135410 r1148584 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 2.6. 58 Version: 2.6.8 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/GenooInit.php
r1135410 r1148584 52 52 define('GENOO_CACHE', GENOO_ROOT . 'cache' . DIRECTORY_SEPARATOR); 53 53 define('GENOO_DEBUG', get_option('genooDebug')); 54 define('GENOO_REFRESH', sha1('genoo-refresh-javascript- without-popup'));54 define('GENOO_REFRESH', sha1('genoo-refresh-javascript-now-please')); 55 55 // start the engine last file to require, rest is auto 56 56 // custom auto loader, PSR-0 Standard -
genoo/trunk/assets/GenooEditPost.js
r1135410 r1148584 264 264 if(r == true){ 265 265 jQuery("#ajax-loading").show(); 266 publish. click();266 publish.trigger('click'); 267 267 } else { 268 268 jQuery("#publish").removeClass().addClass("button-primary"); … … 276 276 if(found == false){ 277 277 jQuery("#ajax-loading").show(); 278 publish. click();278 publish.trigger('click'); 279 279 } 280 280 } else { 281 281 jQuery("#ajax-loading").show(); 282 publish. click();282 publish.trigger('click'); 283 283 } 284 284 }); -
genoo/trunk/libs/Genoo/Admin.php
r1121144 r1148584 12 12 namespace Genoo; 13 13 14 use Genoo\RepositorySettings, 15 Genoo\RepositoryUser, 16 Genoo\RepositoryForms, 17 Genoo\RepositoryLumens, 18 Genoo\Api, 19 Genoo\TableForms, 20 Genoo\TableLumens, 21 Genoo\Wordpress\Utils, 22 Genoo\Wordpress\Settings, 23 Genoo\Wordpress\Page, 24 Genoo\Wordpress\Notice, 25 Genoo\Wordpress\Nag, 26 Genoo\Wordpress\Metabox, 27 Genoo\Wordpress\PostType, 28 Genoo\Wordpress\Action, 29 Genoo\Wordpress\Filter, 30 Genoo\Wordpress\TinyMCE, 31 Genoo\Tools, 32 Genoo\Utils\Strings; 14 use Genoo\RepositorySettings; 15 use Genoo\RepositoryUser; 16 use Genoo\RepositoryForms; 17 use Genoo\RepositoryLumens; 18 use Genoo\Api; 19 use Genoo\TableForms; 20 use Genoo\TableLumens; 21 use Genoo\Wordpress\Utils; 22 use Genoo\Wordpress\Settings; 23 use Genoo\Wordpress\Page; 24 use Genoo\Wordpress\Notice; 25 use Genoo\Wordpress\Nag; 26 use Genoo\Wordpress\Metabox; 27 use Genoo\Wordpress\PostType; 28 use Genoo\Wordpress\Action; 29 use Genoo\Wordpress\Filter; 30 use Genoo\Wordpress\TinyMCE; 31 use Genoo\Tools; 32 use Genoo\Utils\Strings; 33 use Genoo\Wordpress\Debug; 33 34 use Genoo\Wordpress\MetaboxCTA; 34 35 … … 75 76 $this->repositaryLumens = new RepositoryLumens($this->cache, $this->api); 76 77 $this->repositaryCTAs = new RepositoryCTA($this->cache); 77 $this->user = new RepositoryUser();78 $this->settings = new Settings($this->repositarySettings, $this->api);78 // initialise settings and users 79 Action::add('init', array($this, 'init'), 1); 79 80 // admin constructor 80 81 Action::add('current_screen', array($this, 'adminCurrentScreen')); 81 82 Action::add('admin_init', array($this, 'adminInit')); 82 Action::add(' admin_init', array($this, 'adminUI'));83 Action::add('init', array($this, 'adminUI')); 83 84 Action::add('init', array($this, 'adminPostTypes')); 84 85 Action::add('admin_menu', array($this, 'adminMenu')); 85 86 Action::add('admin_notices', array ($this, 'adminNotices')); 86 87 Action::add('admin_enqueue_scripts', array($this, 'adminEnqueueScripts'), 10, 1); 88 } 89 90 /** 91 * Init variables 92 */ 93 public function init() 94 { 95 // We first need to get these, but only after init, 96 // to retrieve all custom post types correclty 97 $this->user = new RepositoryUser(); 98 $this->settings = new Settings($this->repositarySettings, $this->api); 87 99 } 88 100 -
genoo/trunk/libs/Genoo/Table.php
r882847 r1148584 12 12 namespace Genoo; 13 13 14 if(!class_exists('WP_List_Table')){ 15 if(file_exists(ABSPATH . 'wp-admin/includes/class-wp-list-table.php')){ 16 require_once(ABSPATH . 'wp-admin/includes/class-wp-list-table.php'); 17 } 18 // if not, this might fail, do something man, cmon 19 } 14 use Genoo\RepositoryUser; 15 use Genoo\Utils\Strings; 16 use Genoo\Wordpress\Utils; 17 use Genoo\Wordpress\Notice; 18 use Genoo\Wordpress\WPListTable; 20 19 21 22 use Genoo\RepositoryUser, 23 Genoo\Utils\Strings, 24 Genoo\Wordpress\Utils, 25 Genoo\Wordpress\Notice; 26 27 28 abstract class Table extends \WP_List_Table 20 abstract class Table extends \Genoo\Wordpress\WPListTable 29 21 { 30 22 /** @var array() */ -
genoo/trunk/libs/Genoo/TableForms.php
r871929 r1148584 12 12 namespace Genoo; 13 13 14 use Genoo\Wordpress\Utils ,15 Genoo\Wordpress\Notice, 16 Genoo\Tools;14 use Genoo\Wordpress\Utils; 15 use Genoo\Wordpress\Notice; 16 use Genoo\Tools; 17 17 18 18 class TableForms extends Table -
genoo/trunk/libs/Genoo/Wordpress/Post.php
r1121144 r1148584 128 128 */ 129 129 130 public static function getTypes($args = array()){ return get_post_types(array_merge(array('public' => true, 'show_ui' => true), $args), 'objects'); } 130 public static function getTypes($args = array()) 131 { 132 return get_post_types(array_merge(array('public' => true, 'show_ui' => true), $args), 'objects'); 133 } 131 134 132 135 -
genoo/trunk/libs/Genoo/Wordpress/Settings.php
r1121144 r1148584 15 15 Genoo\Utils\Strings, 16 16 Genoo\Wordpress\Notice, 17 Genoo\Wordpress\Action; 17 Genoo\Wordpress\Action, 18 Genoo\Wordpress\Utils; 19 use Genoo\RepositorySettings; 18 20 19 21 class Settings … … 124 126 { 125 127 //register settings sections 126 foreach ($this->sections as $section){ 127 if (false == get_option($section['id'])){ add_option($section['id']); } 128 if (isset($section['desc']) && !empty($section['desc'])){ 129 $section['desc'] = '<div class="inside">'.$section['desc'].'</div>'; 130 $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";'); 131 } else { 132 $callback = '__return_false'; 133 } 134 add_settings_section($section['id'], $section['title'], $callback, $section['id']); 128 if(Utils::isIterable($this->sections)){ 129 foreach($this->sections as $section){ 130 if (false == get_option($section['id'])){ add_option($section['id']); } 131 if (isset($section['desc']) && !empty($section['desc'])){ 132 $section['desc'] = '<div class="inside">'.$section['desc'].'</div>'; 133 $callback = create_function('', 'echo "'.str_replace('"', '\"', $section['desc']).'";'); 134 } else { 135 $callback = '__return_false'; 136 } 137 add_settings_section($section['id'], $section['title'], $callback, $section['id']); 138 } 135 139 } 136 140 //register settings fields 137 foreach($this->fields as $section => $field){ 138 foreach ($field as $option){ 139 if(!empty($option)){ 140 $type = isset($option['type']) ? $option['type'] : 'text'; 141 $args = array( 142 'type' => $type, 143 'id' => $option['name'], 144 'desc' => isset($option['desc']) ? $option['desc'] : null, 145 'name' => $option['label'], 146 'section' => $section, 147 'options' => isset($option['options']) ? $option['options'] : '', 148 'std' => isset($option['default']) ? $option['default'] : '', 149 'attr' => isset($option['attr']) ? $option['attr'] : '' 150 ); 151 add_settings_field($section . '[' . $option['name'] . ']', $option['label'], array($this, 'renderer'), $section, $section, $args); 141 if(Utils::isIterable($this->fields)){ 142 foreach($this->fields as $section => $field){ 143 if(Utils::isIterable($field)){ 144 foreach ($field as $option){ 145 if(!empty($option)){ 146 $type = isset($option['type']) ? $option['type'] : 'text'; 147 $args = array( 148 'type' => $type, 149 'id' => $option['name'], 150 'desc' => isset($option['desc']) ? $option['desc'] : null, 151 'name' => $option['label'], 152 'section' => $section, 153 'options' => isset($option['options']) ? $option['options'] : '', 154 'std' => isset($option['default']) ? $option['default'] : '', 155 'attr' => isset($option['attr']) ? $option['attr'] : '' 156 ); 157 add_settings_field($section . '[' . $option['name'] . ']', $option['label'], array($this, 'renderer'), $section, $section, $args); 158 } 159 } 152 160 } 153 161 } 154 162 } 155 163 // creates our settings in the options table 156 foreach ($this->sections as $section){ 157 register_setting($section['id'], $section['id'], array($this, 'validate')); 164 if(Utils::isIterable($this->sections)){ 165 foreach ($this->sections as $section){ 166 register_setting($section['id'], $section['id'], array($this, 'validate')); 167 } 158 168 } 159 169 } … … 308 318 } 309 319 // go through sections 310 foreach($this->sections as $form){ 311 echo '<div id="'. $form['id'] .'" class="group">'; 312 echo '<form method="post" action="options.php">'; 313 do_action('wsa_form_top_' . $form['id'], $form); 314 settings_fields($form['id']); 315 do_settings_sections($form['id']); 316 do_action('wsa_form_bottom_' . $form['id'], $form); 317 echo '<div style="padding-left: 10px">'; 318 submit_button(); 319 echo '</div>'; 320 echo '</form>'; 321 echo '</div>'; 320 if(Utils::isIterable($this->sections)){ 321 foreach($this->sections as $form){ 322 echo '<div id="'. $form['id'] .'" class="group">'; 323 echo '<form method="post" action="options.php">'; 324 do_action('wsa_form_top_' . $form['id'], $form); 325 settings_fields($form['id']); 326 do_settings_sections($form['id']); 327 do_action('wsa_form_bottom_' . $form['id'], $form); 328 echo '<div style="padding-left: 10px">'; 329 submit_button(); 330 echo '</div>'; 331 echo '</form>'; 332 echo '</div>'; 333 } 322 334 } 323 335 echo '</div>'; -
genoo/trunk/libs/Genoo/Wordpress/Utils.php
r975155 r1148584 126 126 echo $output; 127 127 } 128 129 /** 130 * Is iterable? 131 * 132 * @param $var 133 * @return bool 134 */ 135 public static function isIterable($var) 136 { 137 return $var !== null 138 && (is_array($var) 139 || $var instanceof \Traversable 140 || $var instanceof \Iterator 141 || $var instanceof \IteratorAggregate 142 ); 143 } 128 144 } -
genoo/trunk/readme.txt
r1135410 r1148584 3 3 Tags: marketing automation, email marketing, centralized lead database, lead capture forms 4 4 Requires at least: 3.3 5 Tested up to: 4. 05 Tested up to: 4.2.2 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 2.6. 58 Stable tag: 2.6.8 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results! … … 67 67 == Changelog == 68 68 69 = 2.6.8 = 70 * Added WordPress 4.2.2 listing table support 71 * Added CTA for custom post type 72 69 73 = 2.6 = 70 74 * Added ability to identify multiple CTA's (and their placement within the sidebar) for a specific page or post.
Note: See TracChangeset
for help on using the changeset viewer.