Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding a base class

  • Loading branch information...
commit 5ff31943bdcaf62c76960f244849650efb20a91b 1 parent 3690ebe
@rchavik authored
View
5 README
@@ -0,0 +1,5 @@
+Jquerytools for cakephp Plugin Version 0.1
+------------------------------------------
+
+Good luck and have fun.
+-- rchavik
View
9 config/jqtools.php
@@ -0,0 +1,9 @@
+<?php
+
+$config = array(
+ 'Jqtools' => array(
+ 'version' => '1.2.5',
+ 'minified' => true,
+ 'full' => true,
+ ),
+ );
View
43 views/helpers/jqtools.php
@@ -0,0 +1,43 @@
+<?php
+
+class JqtoolsHelper extends AppHelper {
+
+ var $script = false;
+
+ var $View = null;
+
+ var $helpers = array(
+ 'Html',
+ 'Js' => array(
+ 'Jquery',
+ ),
+ );
+
+ public function __construct($options = array()) {
+ $this->View =& ClassRegistry::getObject('view');
+ Configure::load('Jqtools.jqtools');
+ return parent::__construct($options);
+ }
+
+ public function beforeRender() {
+ if (isset($params['isAjax']) && $params['isAjax'] === true) {
+ return;
+ }
+ if (isset($params['admin']) && $params['admin'] === true) {
+ return;
+ }
+ extract(Configure::read('Jqtools'));
+ if ($full) {
+ $minified = true;
+ $script = '/jqtools/js/build/' . $version . '/jquery.tools';
+ } else {
+ $script = '/jqtools/js/build/' . $version . '/' . $this->script;
+ }
+ if ($minified) {
+ $script .= '.min';
+ }
+
+ $this->Html->script($script, array('inline' => false, 'once' => true));
+ }
+
+}
View
20 views/helpers/tabs.php
@@ -1,25 +1,15 @@
<?php
-class TabsHelper extends AppHelper {
+App::import('Helper', 'Jqtools.Jqtools');
+class TabsHelper extends JqtoolsHelper {
+
+ var $script = 'tabs/tabs';
var $tab = false;
var $tabs = array();
- var $View = null;
-
- var $helpers = array(
- 'Html',
- 'Js' => array(
- 'Jquery',
- ),
- );
-
- public function __construct($options = array()) {
- $this->View =& ClassRegistry::getObject('view');
- return parent::__construct($options);
- }
-
function beforeRender() {
+ parent::beforeRender();
$params = $this->View->params;
if (isset($params['isAjax']) && $params['isAjax'] === true) {
return;
Please sign in to comment.
Something went wrong with that request. Please try again.