Changeset 1346660
- Timestamp:
- 02/09/2016 11:26:26 AM (10 years ago)
- Location:
- genoo/trunk
- Files:
-
- 8 edited
-
Genoo.php (modified) (1 diff)
-
GenooInit.php (modified) (4 diffs)
-
libs/Genoo/Api.php (modified) (4 diffs)
-
libs/Genoo/Frontend.php (modified) (1 diff)
-
libs/Genoo/HtmlForm.php (modified) (5 diffs)
-
libs/Genoo/Shortcodes.php (modified) (1 diff)
-
libs/Genoo/Wordpress/MetaboxBuilder.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1342940 r1346660 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 3.4. 88 Version: 3.4.9 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/GenooInit.php
r1336987 r1346660 56 56 define('GENOO_REFRESH', sha1('added-new-js-css')); 57 57 define('GENOO_DOMAIN', '//api.genoo.com'); 58 define('GENOO_DEV', apply_filters('wpmktengine_dev', FALSE));59 58 // start the engine last file to require, rest is auto 60 59 // custom auto loader, PSR-0 Standard … … 62 61 $classLoader = new GenooRobotLoader('Genoo', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'libs' . DIRECTORY_SEPARATOR); 63 62 $classLoader->register(); 63 // wp init 64 Action::add('plugins_loaded', array($this, 'init')); 65 // wp die 66 Action::add('shutdown', array($this, 'shutdown')); 67 } 68 69 70 /** 71 * Initialize 72 */ 73 74 public function init() 75 { 76 // Rest of constatns 77 define('GENOO_DEV', apply_filters('wpmktengine_dev', FALSE)); 64 78 // initialize 65 79 $this->repositarySettings = new RepositorySettings(); … … 70 84 define('GENOO_SETUP', $this->api->isSetupFull()); 71 85 define('GENOO_LUMENS', $this->api->isLumensSetup()); 72 // wp init 73 Action::add('plugins_loaded', array($this, 'init')); 74 // wp die 75 Action::add('shutdown', array($this, 'shutdown')); 76 } 77 78 79 /** 80 * Initialize 81 */ 82 83 public function init() 84 { 86 85 87 /** 86 88 * 0. Text-domain … … 162 164 add_feed('wpmktengine_cta', function(){ 163 165 // Send headers 166 header('Access-Control-Allow-Origin: *'); 164 167 header('Cache-Control: no-cache, must-revalidate'); 165 168 header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60))); // 1 hour -
genoo/trunk/libs/Genoo/Api.php
r1342947 r1346660 743 743 * @param string $description 744 744 * @param string $url 745 * @return null 745 * @return mixed 746 * @throws ApiException 746 747 */ 747 748 public function putActivityByMail($email, $activityType, $activityName, $description = '', $url = '') … … 758 759 return $leadid; 759 760 } else { 760 //logError('Warning: lead' . $email . ' does not exist.');761 throw new ApiException('No lead for ' . $email . ' found.'); 761 762 } 762 763 } catch (\Exception $e){ 763 //logError('Error during: ' . $activityType . ', Error: ' . $e->getMessage()); 764 } 765 return NULL; 764 throw new ApiException('Error during: ' . $activityType . ', Error: ' . $e->getMessage()); 765 } 766 766 } 767 767 … … 835 835 private function call($action, $params = null) 836 836 { 837 838 839 837 try{ 840 838 switch($action){ … … 979 977 980 978 class ApiException extends \Exception{} 979 class ApiNoteException extends \Exception{} -
genoo/trunk/libs/Genoo/Frontend.php
r1342940 r1346660 320 320 $modalGutsInject->appendMsg($widgetMsgSuccess, $modalResult); 321 321 } 322 $modalGutsInject->hideRequired(); 322 323 } 323 324 // add html with injected values -
genoo/trunk/libs/Genoo/HtmlForm.php
r1333632 r1346660 24 24 /** @var */ 25 25 private $form_key; 26 /** @var */ 27 private $form_return = NULL; 26 28 /** @var */ 27 29 private $form_id; … … 30 32 /** Form key */ 31 33 const FORM_KEY = '{{FORM_KEY}}'; 34 const FORM_RETURN = '{{FORM_RETURN}}'; 32 35 33 36 … … 135 138 if($array){ 136 139 foreach($array as $key => $value){ 140 // This one behaves specially 141 if($key == 'returnModalUrl'){ 142 $this->form_return = $value; 143 $value = self::FORM_RETURN; 144 } 137 145 $node = $this->dom->createElement("input"); 138 146 $node->setAttribute("type","hidden"); … … 176 184 $fragment->appendXML($html); 177 185 $this->msg->appendChild($fragment); 186 } 187 } 188 } 189 190 191 /** 192 * Hide required field 193 * after the form was submitted 194 */ 195 196 public function hideRequired() 197 { 198 // Find span 199 $span = $this->dom->getElementsByTagName("span"); 200 // Do we have elements? 201 if($span instanceof \DOMNodeList){ 202 foreach($span as $element){ 203 // Remove if parent 204 if($element->parentNode){ 205 $element->parentNode->removeChild($element); 206 } 178 207 } 179 208 } … … 207 236 // And then return the form_key 208 237 $data = str_replace(self::FORM_KEY, $this->form_key, $data); 238 if($this->form_return !== NULL){ 239 $data = str_replace(self::FORM_RETURN, $this->form_return, $data); 240 } 241 // Done 209 242 } 210 243 // Return -
genoo/trunk/libs/Genoo/Shortcodes.php
r1121144 r1346660 149 149 $inject->appendMsg($formSuccess, $result); 150 150 } 151 // Hide required if any 152 $inject->hideRequired(); 151 153 } 152 154 // return html -
genoo/trunk/libs/Genoo/Wordpress/MetaboxBuilder.php
r1287280 r1346660 537 537 if($name == 'form' && $this->formValue($name) !== ''){ 538 538 $array = $this->forms->getFormsArray(); 539 echo '<div class="bContent">'. $array[$this->formValue($name)] .'</div>'; 539 $value = array_key_exists($this->formValue($name), $array) ? $array[$this->formValue($name)] : ''; 540 echo '<div class="bContent">'. $value .'</div>'; 540 541 } elseif($name == 'image' && $this->formIsChecked($name . '-on')){ 541 542 $value = $this->formValue($name); … … 651 652 $r->content .= '<div class="clear"></div>'; 652 653 // Put it all together 653 $r->content = '';654 654 $hideRest = FALSE; 655 655 if(isset($_GET['modalWindow']) && !is_null($readyId) && $_GET['modalWindow'] == 'modalWindow' . ucfirst($readyId)){ -
genoo/trunk/readme.txt
r1342940 r1346660 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 3.4. 88 Stable tag: 3.4.9 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results! … … 68 68 69 69 == Changelog == 70 71 = 3.4.9 = 72 * Removing "required field" after form submission 73 * Fixed error for not found form response according to form indicator in GET parameters 74 * Allowing CTA feed from any origin 70 75 71 76 = 3.4.8 =
Note: See TracChangeset
for help on using the changeset viewer.