Skip to content

Instantly share code, notes, and snippets.

View oligriffiths's full-sized avatar

Oli Griffiths oligriffiths

View GitHub Profile
<?php
/**
a. Embedding the user ID as a query string variable seems like a bad idea. I assume you’re using that to set a model state when you do your browse page. Here is what I would do:
1) create a settings controller if you haven’t already
2) depending upon which actions you need the user id set for, I would either set it as a model state in the controller constructor if you need user id set for all actions:
**/
@oligriffiths
oligriffiths / gist:5940720
Created July 6, 2013 18:12
Koowa default plugin
<?php
/**
* @version $Id$
* @package Nooku_Plugins
* @subpackage Koowa
* @copyright Copyright (C) 2007 - 2012 Johan Janssens. All rights reserved.
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.nooku.org
*/
@oligriffiths
oligriffiths / gist:5940659
Last active December 19, 2015 10:29
Docman example plugin
<?php
/**
* @package Koowa.Plugin
* @subpackage Docman
*
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('KOOWA') or die;
(function($){
var filters = {
int: function(value){return typeof parseInt(value) !== 'NaN' ? parseInt(value) : null},
float: function(value){return typeof parseFloat(value) !== 'NaN' ? parseFloat(value) : null},
string: function(value){return ['string','boolean','number'].indexOf(typeof value) !== -1 ? value+'' : null},
array: function(value){return typeof value === 'object' && value.constructor === Array ? value : null},
object: function(value){return typeof value === 'object' ? value : null}
}