Changeset 1328926
- Timestamp:
- 01/15/2016 11:31:11 AM (10 years ago)
- Location:
- genoo/trunk
- Files:
-
- 9 edited
-
Genoo.php (modified) (1 diff)
-
GenooInit.php (modified) (1 diff)
-
libs/Genoo/Admin.php (modified) (1 diff)
-
libs/Genoo/Api.php (modified) (2 diffs)
-
libs/Genoo/CTA.php (modified) (2 diffs)
-
libs/Genoo/ModalWindow.php (modified) (3 diffs)
-
libs/Genoo/WidgetCTA.php (modified) (4 diffs)
-
libs/Genoo/WidgetForm.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
genoo/trunk/Genoo.php
r1326466 r1328926 6 6 Author URI: http://www.genoo.com/ 7 7 Author Email: info@genoo.com 8 Version: 3.4 8 Version: 3.4.5 9 9 License: GPLv2 10 10 Text Domain: genoo -
genoo/trunk/GenooInit.php
r1326466 r1328926 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)); 58 59 // start the engine last file to require, rest is auto 59 60 // custom auto loader, PSR-0 Standard -
genoo/trunk/libs/Genoo/Admin.php
r1326466 r1328926 448 448 'label' => __('Button Hover Image', 'genoo') 449 449 ), 450 array( 451 'type' => 'text', 452 'label' => __('Button CSS ID', 'wpmktengine'), 453 ), 454 array( 455 'type' => 'text', 456 'label' => __('Button CSS Class', 'wpmktengine'), 457 ), 450 458 $this->repositarySettings->getLumensDropdown($this->repositaryLumens) 451 459 ) -
genoo/trunk/libs/Genoo/Api.php
r1326466 r1328926 432 432 // leads 433 433 $result = $this->call(self::POST_STREAM_TYPES, array( 434 'name' => (string)$name, 435 'description' => $description, 434 array( 435 'name' => (string)$name, 436 'description' => $description, 437 ) 436 438 )); 437 439 // return 438 if((is_object($result)) && (isset($result->result)) && ($result->result == 'success')){ 439 return TRUE; 440 } 440 if(is_array($result) && (isset($result[0]))){ 441 if(is_object($result[0]) && (isset($result[0]->result)) && ($result[0]->result == 'success')){ 442 return TRUE; 443 } else { 444 return FALSE; 445 } 446 }; 441 447 return FALSE; 448 } 449 450 451 /** 452 * Stream type full as an array 453 * 454 * @param array $array 455 * @return bool 456 * @throws ApiException 457 */ 458 459 public function setStreamTypes($array = array()) 460 { 461 if(empty($array) || !is_array($array)){ 462 throw new \InvalidArgumentException(__('setStreamTypes accepts only non-empty array as an argument.', 'genoo')); 463 } 464 return $this->call(self::POST_STREAM_TYPES, $array); 442 465 } 443 466 … … 863 886 // prep action and lastQuery 864 887 $prepAction = $action; 865 $prepUrl = ( self::DEV ? self::URL_DEV : self::URL) . str_replace(array('[A]','[S]', '[P]'), '', $action);888 $prepUrl = (GENOO_DEV ? self::URL_DEV : self::URL) . str_replace(array('[A]','[S]', '[P]'), '', $action); 866 889 // build query arguments 867 890 if(Strings::endsWith($prepAction, "[S]")){ -
genoo/trunk/libs/Genoo/CTA.php
r1287280 r1328926 82 82 /** @var bool */ 83 83 public $followOriginalUrl = false; 84 /** @var */ 85 public $button_id; 86 /** @var */ 87 public $button_class; 84 88 85 89 … … 186 190 $this->displayTitle = ($k == true && ($z == 'titledesc' || $z == 'title')) ? true : false; 187 191 $this->displayDesc = ($k == true && ($z == 'titledesc' || $z == 'desc')) ? true : false; 192 $this->button_id = $this->post->getMeta('button_css_id'); 193 $this->button_class = $this->post->getMeta('button_css_class'); 188 194 if($this->isForm){ 189 195 $this->followOriginalUrl = $this->post->getMeta('follow_original_return_url') == 0 ? FALSE : TRUE; -
genoo/trunk/libs/Genoo/ModalWindow.php
r975155 r1328926 69 69 $modalWindow->aria = $modalWindow->visibility ? '' : 'hidden aria-hidden="true"'; 70 70 $modalWindow->id = self::getModalId($id); 71 $modalWindow->class = $modalWindow->visibility ? 'visible renderedVisible ' : '';71 $modalWindow->class = $modalWindow->visibility ? 'visible renderedVisible ' : ''; 72 72 $modalWindow->class .= $class; 73 73 $modalWindow->tabIndex = $this->countModals() + 1; … … 158 158 * @param bool $button 159 159 * @param $class 160 * @param $cssid 160 161 * @return string 161 162 */ 162 163 163 public static function button($title, $id, $button = true, $class = null, $mobile = false )164 public static function button($title, $id, $button = true, $class = null, $mobile = false, $cssid = '') 164 165 { 165 166 // prep … … 179 180 180 181 $t = ''; 181 $r .= '<form method="POST" action="'. $link .'" '.$formTarget.'>';182 $r .= '<input type="submit" class="'. $class .'" '. $linkOnClick .' value="'. $title .'">';182 $r .= '<form method="POST" id="genooButtonForm" action="'. $link .'" '.$formTarget.'>'; 183 $r .= '<input type="submit" id="'. $cssid .'" class="'. $class .'" '. $linkOnClick .' value="'. $title .'">'; 183 184 $r .= '</form>'; 184 185 -
genoo/trunk/libs/Genoo/WidgetCTA.php
r1314410 r1328926 216 216 return $instance; 217 217 } 218 219 218 220 219 /** … … 258 257 $instance['hideButtonTIME'] = isset($this->shortcodeAtts['time']) ? $this->shortcodeAtts['time'] : 0; 259 258 $instance['followOriginalUrl'] = $this->cta->followOriginalUrl; 259 $instance['originalCTA'] = $this->cta; 260 260 $isHidePopOver = $instance['isPopOver'] && $instance['popOverHide'] ? TRUE : FALSE; 261 261 if($this->cta->isForm || $this->cta->isClasslist){ … … 284 284 $r .= '<div class="genooInlineBlock '. $alignClass .'">'; 285 285 } 286 // Set attributes 287 $attributes = ''; 288 if(isset($this->cta->button_class) || isset($this->cta->button_id)){ 289 // Added filters to apply custom class and id from plugins or 290 // theme modifications 291 $attribute_id = apply_filters( 292 'wpmktengine_cta_button_css_id', 293 $this->cta->button_id, 294 $this->id, 295 $this->cta 296 ); 297 $attribute_class = apply_filters( 298 'wpmktengine_cta_button_css_class', 299 $this->cta->button_class, 300 $this->id, 301 $this->cta 302 ); 303 $attributes = 'id="'. $attribute_id .'" class="'. $attribute_class .'"'; 304 } 286 305 $r .= '<form '. $blank .' method="POST" action="'. $this->cta->link .'">'; 287 306 $r .= '<span id="'. $bid .'" '. $hidden .'>'; 288 $r .= '<inputtype="submit" value="'. $this->cta->linkText .'" '. $isAdditionalAttributes .' />';289 $r .= '</span>';307 $r .= '<input '. $attributes .' type="submit" value="'. $this->cta->linkText .'" '. $isAdditionalAttributes .' />'; 308 $r .= '</span>'; 290 309 $r .= '</form>'; 291 310 if($isInlineBlock){ … … 296 315 } 297 316 } elseif($this->cta->isClasslist){ 298 //$r .= print_r($this->cta); 317 299 318 } 300 319 $r .= isset($args['after_widget']) ? $args['after_widget'] : ''; -
genoo/trunk/libs/Genoo/WidgetForm.php
r1289849 r1328926 102 102 // Form popover hide button? 103 103 $isHidePopOver = (isset($instance['isPopOver']) && $instance['isPopOver']) && (isset($instance['popOverHide']) && $instance['popOverHide']) ? TRUE : FALSE; 104 // Attributes with filters 105 $attribute_id = ''; 106 $attribute_class = ''; 107 if(array_key_exists('originalCTA', $instance)){ 108 if(isset($instance['originalCTA']->button_id) && isset($instance['originalCTA']->button_class)){ 109 $attribute_id = apply_filters( 110 'wpmktengine_cta_button_css_id', 111 $instance['originalCTA']->button_id, 112 $this->id, 113 $instance['originalCTA'] 114 ); 115 $attribute_class = apply_filters( 116 'wpmktengine_cta_button_css_class', 117 $instance['originalCTA']->button_class, 118 $this->id, 119 $instance['originalCTA'] 120 ); 121 } 122 } 104 123 // if form is not in modal window 105 124 if($formModal == false){ … … 174 193 // Skipping mobile button? Shortcodes cant deal with mobile button now 175 194 if($formHSkipMobileButton){ 176 $html .= '<span>' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '<div class="clear"></div></span>';195 $html .= '<span>' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '<div class="clear"></div></span>'; 177 196 } else { 178 $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '<div class="clear"></div></span>';197 $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '<div class="clear"></div></span>'; 179 198 if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){ 180 199 } else { 181 $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, false, 'genooButton form-button-submit', true) . '<div class="clear"></div></span>';200 $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, FALSE, 'genooButton form-button-submit ' . $attribute_class, TRUE, $attribute_id) . '<div class="clear"></div></span>'; 182 201 } 183 202 } … … 187 206 // classic html button 188 207 if($is_macIE || $is_winIE || $is_IE || $formHSkipMobileButton){ 189 $html .= '<span>' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '</span>';208 $html .= '<span>' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '</span>'; 190 209 } else { 191 $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, true, 'genooButton form-button-submit') . '</span>';192 if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){210 $html .= '<span class="genooDisplayDesktop">' . ModalWindow::button($formButton, $this->id, TRUE, 'genooButton form-button-submit ' . $attribute_class, FALSE, $attribute_id) . '</span>'; 211 if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == FALSE){ 193 212 } else { 194 $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, false, 'genooButton form-button-submit', true) . '</span>';213 $html .= '<span class="genooDisplayMobile">' . ModalWindow::button($formButton, $this->id, FALSE, 'genooButton form-button-submit ' . $attribute_class, TRUE, $attribute_id) . '</span>'; 195 214 } 196 215 } 197 216 } 198 217 // Remove desktop display, if not needed 199 if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == false){218 if(isset($instance['canHaveMobile']) && $instance['canHaveMobile'] == FALSE){ 200 219 $html = str_replace('class="genooDisplayDesktop"', '', $html); 201 220 } -
genoo/trunk/readme.txt
r1326466 r1328926 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 8 Stable tag: 3.4 8 Stable tag: 3.4.5 9 9 10 10 Combine the flexibility of WordPress with the power of Genoo and experience amazing results! … … 67 67 68 68 == Changelog == 69 70 = 3.4.5 = 71 * Added ability to ad custom CSS class and ID to CTA buttons 69 72 70 73 = 3.4.0 =
Note: See TracChangeset
for help on using the changeset viewer.