This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(!window.console || !window.console.firebug) { | |
window.console = { | |
debug: function(){}, | |
log: function(){} | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!window.console || !console.firebug) | |
{ | |
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", | |
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; | |
window.console = {}; | |
for (var i = 0; i < names.length; ++i) | |
window.console[names[i]] = function() {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var win = new Ext.Window({ | |
..... | |
,items:[ | |
new Ext.FormPanel({ | |
,url:'[% Catalyst.uri_for('/save') %]' | |
,id: 'fp' | |
..... | |
,items: [{ | |
fieldLabel: 'First name', | |
name: 'first', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fp = win.findById('fp'); | |
fp.on('actioncomplete', function(a, fp) { | |
var r = fp.result; | |
for (var field in r.error) { | |
fp.form.findField(field).markInvalid( | |
r.error[field].join("<br/>") | |
); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub save : Global { | |
my ( $self, $c ) = @_; | |
$c->form( | |
first => [ qw/NOT_BLANK ASCII/ => [qw/LENGTH 2 20/] ], | |
last => [ qw/NOT_BLANK ASCII/ => [qw/LENGTH 2 20/] ], | |
company => [ qw/NOT_BLANK ASCII/ => [qw/LENGTH 2 20/] ], | |
email => [qw/NOT_BLANK EMAIL_LOOSE/], | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svn co http://code2.0beta.co.uk/mojomojo/svn/trunk/ MojoMojo | |
cd MojoMojo | |
perl Makefile.PL | |
make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Model::DBIC> | |
connect_info dbi:mysql:mojomojo | |
connect_info mojomojo | |
connect_info sTrOnGpAsSwOrD | |
</Model::DBIC> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<permissions> | |
check_permission_on_view 1 | |
cache_permission_data 1 | |
create_allowed 0 | |
delete_allowed 0 | |
edit_allowed 0 | |
view_allowed 0 | |
attachment_allowed 0 | |
</permissions> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- add a new role | |
insert into role values (null, 'user', 1); | |
-- add this role to the standard admin user | |
insert into role_member values (1, 2, 1); | |
-- allow everything to that new role | |
insert into path_permissions values | |
('/', 1, 'no', 'yes', 'yes', 'yes', 'yes', 'yes'); | |
insert into path_permissions values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select * from role; | |
+----+------+--------+ | |
| id | name | active | | |
+----+------+--------+ | |
| 1 | user | 1 | | |
+----+------+--------+ | |
mysql> select * from role_member; | |
+------+--------+-------+ | |
| role | person | admin | |