@@ -20,10 +20,10 @@ |
||
| 20 | 20 | // Leave in front to have it available in all Components |
| 21 | 21 | 'Detectors.Detectors', |
| 22 | 22 | /** |
| 23 | - * You have to have Cookie before CurrentUser to have the salt initialized. |
|
| 24 | - * Check by deleting Session cookie when persistent cookie is present. |
|
| 25 | - * @td maybe bug in Cake, because Cookies should be initialized in CurrentUser's $components |
|
| 26 | - */ |
|
| 23 | + * You have to have Cookie before CurrentUser to have the salt initialized. |
|
| 24 | + * Check by deleting Session cookie when persistent cookie is present. |
|
| 25 | + * @td maybe bug in Cake, because Cookies should be initialized in CurrentUser's $components |
|
| 26 | + */ |
|
| 27 | 27 | 'Cookie', |
| 28 | 28 | 'CurrentUser', |
| 29 | 29 | 'CacheSupport', |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | $this->captcha_result = $numberOne - $numberTwo; |
| 57 | 57 | |
| 58 | 58 | # Session-Way (only one form at a time) - must be a component then |
| 59 | - //$this->Session->write('Captcha.result', $result); |
|
| 59 | + //$this->Session->write('Captcha.result', $result); |
|
| 60 | 60 | |
| 61 | - # DB-Way (several forms possible, high security via IP-Based max limits) |
|
| 62 | - // the following should be done in a component and passed to the view/helper |
|
| 63 | - // $Captcha = ClassRegistry::init('Captcha'); |
|
| 64 | - // $Captcha->new(); $Captcha->update(); etc |
|
| 61 | + # DB-Way (several forms possible, high security via IP-Based max limits) |
|
| 62 | + // the following should be done in a component and passed to the view/helper |
|
| 63 | + // $Captcha = ClassRegistry::init('Captcha'); |
|
| 64 | + // $Captcha->new(); $Captcha->update(); etc |
|
| 65 | 65 | |
| 66 | 66 | # Timestamp-SessionID-Hash-Way (several forms possible, not as secure) |
| 67 | 67 | $this->captcha_hash = SimpleCaptcha::buildHash(array('timestamp' => time(), 'result' => $this->captcha_result), $this->options); |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | # add passive part on active forms as well |
| 95 | 95 | $out = '<div style="display:none">'. |
| 96 | - $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)). |
|
| 97 | - $this->Form->input($field.'_time', array('value'=>time())). |
|
| 98 | - $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')). |
|
| 99 | - '</div>'; |
|
| 96 | + $this->Form->input($field.'_hash', array('value'=>$this->captcha_hash)). |
|
| 97 | + $this->Form->input($field.'_time', array('value'=>time())). |
|
| 98 | + $this->Form->input((!empty($model)?$model.'.':'').$this->options['dummyField'], array('value'=>'')). |
|
| 99 | + '</div>'; |
|
| 100 | 100 | |
| 101 | 101 | return $out; |
| 102 | 102 | } |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | if ($options['combined'] === true) { |
| 136 | - $options['between'] = $out.' = '; |
|
| 137 | - } |
|
| 136 | + $options['between'] = $out.' = '; |
|
| 137 | + } |
|
| 138 | 138 | unset($options['combined']); |
| 139 | 139 | |
| 140 | 140 | return $this->Form->input($this->__fieldName($model), $options); |
@@ -208,8 +208,8 @@ |
||
| 208 | 208 | Configure::write('Saito.Globals.postingsPerThread', 10); |
| 209 | 209 | |
| 210 | 210 | /** |
| 211 | - * Check if the forum is installed |
|
| 212 | - */ |
|
| 211 | + * Check if the forum is installed |
|
| 212 | + */ |
|
| 213 | 213 | if ( file_exists(APP . 'Config' . DS . 'installed.txt') ) : |
| 214 | 214 | Configure::write('Saito.installed', TRUE); |
| 215 | 215 | else : |
@@ -135,9 +135,9 @@ |
||
| 135 | 135 | */ |
| 136 | 136 | Configure::write('Routing.prefixes', array('admin')); |
| 137 | 137 | /** |
| 138 | - * Turn off all caching application-wide. |
|
| 139 | - * |
|
| 140 | - */ |
|
| 138 | + * Turn off all caching application-wide. |
|
| 139 | + * |
|
| 140 | + */ |
|
| 141 | 141 | //Configure::write('Cache.disable', true); |
| 142 | 142 | |
| 143 | 143 | /** |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Add additional buttons to editor |
| 49 | - * |
|
| 50 | - * You can theme them with |
|
| 51 | - * |
|
| 52 | - * <code> |
|
| 53 | - * .markItUp .markItUpButton<Id> a { |
|
| 54 | - * … |
|
| 55 | - * } |
|
| 56 | - * </code> |
|
| 49 | + * |
|
| 50 | + * You can theme them with |
|
| 51 | + * |
|
| 52 | + * <code> |
|
| 53 | + * .markItUp .markItUpButton<Id> a { |
|
| 54 | + * … |
|
| 55 | + * } |
|
| 56 | + * </code> |
|
| 57 | 57 | * |
| 58 | 58 | /* |
| 59 | 59 | Configure::write( |
@@ -75,22 +75,22 @@ discard block |
||
| 75 | 75 | // image in img/markitup/<replacement> |
| 76 | 76 | 'replacement' => 'resultofbutton1.png' |
| 77 | 77 | ), |
| 78 | - * // … |
|
| 78 | + * // … |
|
| 79 | 79 | ) |
| 80 | 80 | ); |
| 81 | - * |
|
| 82 | - */ |
|
| 81 | + * |
|
| 82 | + */ |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * Users to notify via email if a new users registers successfully |
| 86 | - * |
|
| 87 | - * Provide an array with user IDs. To notify the admin (usually user-id 1): |
|
| 88 | - * |
|
| 89 | - * [1] |
|
| 90 | - * |
|
| 91 | - * To notify the admin with id 1 and the user with the id 5: |
|
| 92 | - * |
|
| 93 | - * [1, 5] |
|
| 86 | + * |
|
| 87 | + * Provide an array with user IDs. To notify the admin (usually user-id 1): |
|
| 88 | + * |
|
| 89 | + * [1] |
|
| 90 | + * |
|
| 91 | + * To notify the admin with id 1 and the user with the id 5: |
|
| 92 | + * |
|
| 93 | + * [1, 5] |
|
| 94 | 94 | */ |
| 95 | 95 | /* |
| 96 | 96 | Configure::write('Saito.Notification.userActivatedAdminNoticeToUserWithID', [1]); |
@@ -2,54 +2,54 @@ discard block |
||
| 2 | 2 | // @codingStandardsIgnoreFile |
| 3 | 3 | App::uses('AppHelper', 'View/Helper'); |
| 4 | 4 | /** |
| 5 | - * Farbtastic helper |
|
| 6 | - * @author Curtis Gibby |
|
| 7 | - * @author Sebastian Siedentopf |
|
| 8 | - * @desc This helper does everything you need related to Farbtastic within CakePHP |
|
| 9 | - * |
|
| 10 | - * Like Farbtastic, requires jQuery to function properly. |
|
| 11 | - * jQuery: http://jquery.com |
|
| 12 | - * |
|
| 13 | - * Also requires a Color Wheel icon (color.png in this example) |
|
| 14 | - * like the one from Mark James' Silk set |
|
| 15 | - * http://www.iconfinder.net/icondetails/5185/16/ |
|
| 16 | - * |
|
| 17 | - * @version 2010-07-18 |
|
| 18 | - * @td make plugin, fork from http://bakery.cakephp.org/articles/view/helper-for-farbtastic-jquery-color-picker to githup |
|
| 19 | - */ |
|
| 5 | + * Farbtastic helper |
|
| 6 | + * @author Curtis Gibby |
|
| 7 | + * @author Sebastian Siedentopf |
|
| 8 | + * @desc This helper does everything you need related to Farbtastic within CakePHP |
|
| 9 | + * |
|
| 10 | + * Like Farbtastic, requires jQuery to function properly. |
|
| 11 | + * jQuery: http://jquery.com |
|
| 12 | + * |
|
| 13 | + * Also requires a Color Wheel icon (color.png in this example) |
|
| 14 | + * like the one from Mark James' Silk set |
|
| 15 | + * http://www.iconfinder.net/icondetails/5185/16/ |
|
| 16 | + * |
|
| 17 | + * @version 2010-07-18 |
|
| 18 | + * @td make plugin, fork from http://bakery.cakephp.org/articles/view/helper-for-farbtastic-jquery-color-picker to githup |
|
| 19 | + */ |
|
| 20 | 20 | class FarbtasticHelper extends Helper { |
| 21 | 21 | |
| 22 | - public $helpers = ['Form', 'Html']; |
|
| 22 | + public $helpers = ['Form', 'Html']; |
|
| 23 | 23 | |
| 24 | 24 | protected $output_files = true; |
| 25 | 25 | |
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Generate a form input and related div and icon |
|
| 29 | - * |
|
| 30 | - * may need to customize $icon_file (relative to webroot) |
|
| 31 | - * |
|
| 32 | - * Adapted from April Hodge Silver's "Simple Colorpicker" input function |
|
| 33 | - * http://bakery.cakephp.org/articles/view/simple-colorpicker |
|
| 34 | - */ |
|
| 35 | - function input($name, $label='') { |
|
| 27 | + /** |
|
| 28 | + * Generate a form input and related div and icon |
|
| 29 | + * |
|
| 30 | + * may need to customize $icon_file (relative to webroot) |
|
| 31 | + * |
|
| 32 | + * Adapted from April Hodge Silver's "Simple Colorpicker" input function |
|
| 33 | + * http://bakery.cakephp.org/articles/view/simple-colorpicker |
|
| 34 | + */ |
|
| 35 | + function input($name, $label='') { |
|
| 36 | 36 | |
| 37 | - $icon_file = '../../js/farbtastic/color.png'; // update to wherever your icon is. |
|
| 37 | + $icon_file = '../../js/farbtastic/color.png'; // update to wherever your icon is. |
|
| 38 | 38 | |
| 39 | - list($model, $fieldname) = explode('.', $name); |
|
| 40 | - if (empty($label)) { |
|
| 41 | - $label = Inflector::Humanize($fieldname); |
|
| 42 | - } |
|
| 39 | + list($model, $fieldname) = explode('.', $name); |
|
| 40 | + if (empty($label)) { |
|
| 41 | + $label = Inflector::Humanize($fieldname); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - if(isset($this->request->data[$model][$fieldname])) { |
|
| 45 | - $color_value = str_replace("#", "", $this->request->data[$model][$fieldname]); // expects an RGB string, strips any incoming '#' character |
|
| 46 | - } |
|
| 47 | - else { |
|
| 48 | - $color_value = "000000"; // black |
|
| 49 | - } |
|
| 44 | + if(isset($this->request->data[$model][$fieldname])) { |
|
| 45 | + $color_value = str_replace("#", "", $this->request->data[$model][$fieldname]); // expects an RGB string, strips any incoming '#' character |
|
| 46 | + } |
|
| 47 | + else { |
|
| 48 | + $color_value = "000000"; // black |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - $str = ''; |
|
| 52 | - $str .= '<div class="input text colorpicker">'; |
|
| 51 | + $str = ''; |
|
| 52 | + $str .= '<div class="input text colorpicker">'; |
|
| 53 | 53 | $str .= $this->Form->input($fieldname, [ |
| 54 | 54 | 'id' => $model . Inflector::Camelize($fieldname), |
| 55 | 55 | 'class' => 'farbtastic-input', |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | 'label' => $label, |
| 58 | 58 | 'value' => "#$color_value" |
| 59 | 59 | ]); |
| 60 | - $str .= '<img id="farbtastic-picker-icon-'.Inflector::Camelize($fieldname).'" src="'.$icon_file.'" alt="Color Picker" title="Color Picker" class="farbtastic-picker-icon">'; |
|
| 61 | - $str .= '<div style="display:none;" class="farbtastic-picker" id="farbtastic-picker-'.Inflector::Camelize($fieldname).'"></div>'; |
|
| 62 | - $str .= '</div>'; |
|
| 60 | + $str .= '<img id="farbtastic-picker-icon-'.Inflector::Camelize($fieldname).'" src="'.$icon_file.'" alt="Color Picker" title="Color Picker" class="farbtastic-picker-icon">'; |
|
| 61 | + $str .= '<div style="display:none;" class="farbtastic-picker" id="farbtastic-picker-'.Inflector::Camelize($fieldname).'"></div>'; |
|
| 62 | + $str .= '</div>'; |
|
| 63 | 63 | |
| 64 | 64 | $this->readyJS($name); |
| 65 | 65 | |
@@ -70,21 +70,21 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | $this->output_files = false; |
| 72 | 72 | |
| 73 | - return $str; |
|
| 74 | - } |
|
| 73 | + return $str; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | |
| 78 | - /** |
|
| 79 | - * Add the jQuery magic to the $(document).ready function |
|
| 80 | - * Farbtastic-ize the input, make the button show/hide the color picker div |
|
| 81 | - */ |
|
| 82 | - function readyJS($name) { |
|
| 83 | - list($model,$fieldname) = explode('.',$name); |
|
| 84 | - $str = '$(document).ready(function() { '; |
|
| 85 | - $str .= ' $("#farbtastic-picker-'.Inflector::Camelize($fieldname).'").farbtastic("#'.$model.Inflector::Camelize($fieldname).'"); '; |
|
| 86 | - $str .= ' $("#farbtastic-picker-icon-'.Inflector::Camelize($fieldname).'").click( function() { $("#farbtastic-picker-'.Inflector::Camelize($fieldname).'").toggle("slow"); }); '; |
|
| 87 | - $str .= '})'; |
|
| 78 | + /** |
|
| 79 | + * Add the jQuery magic to the $(document).ready function |
|
| 80 | + * Farbtastic-ize the input, make the button show/hide the color picker div |
|
| 81 | + */ |
|
| 82 | + function readyJS($name) { |
|
| 83 | + list($model,$fieldname) = explode('.',$name); |
|
| 84 | + $str = '$(document).ready(function() { '; |
|
| 85 | + $str .= ' $("#farbtastic-picker-'.Inflector::Camelize($fieldname).'").farbtastic("#'.$model.Inflector::Camelize($fieldname).'"); '; |
|
| 86 | + $str .= ' $("#farbtastic-picker-icon-'.Inflector::Camelize($fieldname).'").click( function() { $("#farbtastic-picker-'.Inflector::Camelize($fieldname).'").toggle("slow"); }); '; |
|
| 87 | + $str .= '})'; |
|
| 88 | 88 | $this->Html->scriptBlock($str, array('inline'=>false)); |
| 89 | - } |
|
| 89 | + } |
|
| 90 | 90 | }?> |
| 91 | 91 | \ No newline at end of file |