This file contains 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
/* | |
* /users/edit/<user id> | |
* I am editing a user. | |
*/ | |
get( users, edit, ID ) :- | |
number( ID ), | |
is_admin or session( id, ID ), | |
users:get_user( ID, User ), | |
users:view( edit, User ). |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<?php content( 'css', 'site/css' ) ?> | |
</head> | |
<body> | |
<?php content() ?> | |
</body> |
This file contains 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
<?php | |
/** | |
* Starts the PMC Proxy for redirecting to /app/view/blog | |
* | |
* @package PlayMyCode | |
* @subpackage PMC_Proxy | |
*/ | |
define( 'ACCESS_OK', true ); | |
include_once( $_SERVER["DOCUMENT_ROOT"] . '/flexi/flexi.php' ); |
This file contains 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
<?php | |
/** | |
* @param title Large text topic title. | |
* @param content Text content. | |
* @param displayTime Display time text such as 'last week' | |
* @param cssClass CSS class for the post. | |
* @param id An id for the comment container | |
* @param options link such as "click to expand" | |
*/ | |
params( $title, $content, $displayTime, $cssClass, $id, $options ); |
This file contains 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
<? | |
ajax()->login = function() { | |
// is already logged in | |
ajax()->verify( function() { | |
return $this->obj->session->isLoggedIn(); | |
}); | |
// login with all details | |
ajax()-> | |
verify( function($username, $password, $location, $user, $error) { |
This file contains 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
<? | |
get( 'login' ); | |
post()->login = function() { | |
// is already logged in | |
post()-> | |
verify( function() { | |
return $this->obj->session->isLoggedIn(); | |
})-> | |
redirect( '/' ); |
This file contains 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
<? | |
/** | |
* Pretty Errors | |
* | |
* ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### | |
* | |
* WARNING! It is downright _DANGEROUS_ to use this in production, on | |
* a live website. It should *ONLY* be used for development. | |
* | |
* Pretty Errors allows the outside world to alter your project, |
This file contains 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
<? | |
/** | |
* Pretty Errors | |
* | |
* ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### | |
* | |
* WARNING! It is downright _DANGEROUS_ to use this in production, on | |
* a live website. It should *ONLY* be used for development. | |
* | |
* Pretty Errors allows the outside world to alter your project, |
This file contains 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
\pretty_errors\reportErrors( array( | |
'ignore_folders' => array( 'flexi\\' ), | |
'application_folders' => array( 'app\\' ), | |
'background_text' => 'terse.' | |
) ); |
This file contains 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
<? | |
get( '/blog/show/{title}' )-> | |
validate( function( $title, &$post ) { $post = $this->model->posts->get( $title ); } )-> | |
action( | |
function( $post ) { | |
$this->view( 'blog/post', $post ); | |
}, | |
function( $title ) { | |
$this->view( '404', "Blog post not found " . h($title) ); |
OlderNewer