Permalink
Browse files

Cleanup and fix errors.

  • Loading branch information...
1 parent 205467e commit a40efc18787fe9c209d7d371fe690c83bcbc2506 @markstory markstory committed Jul 16, 2012
View
5 .htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine on
+ RewriteRule ^$ webroot/ [L]
+ RewriteRule (.*) webroot/$1 [L]
+</IfModule>
View
37 Config/routes.php
@@ -1,33 +1,4 @@
<?php
-/* SVN FILE: $Id: routes.php 296 2007-07-21 14:08:12Z gwoo $ */
-/**
- * Short description for file.
- *
- * In this file, you set up routes to your controllers and their actions.
- * Routes are very important mechanism that allows you to freely connect
- * different urls to chosen controllers and their actions (functions).
- *
- * PHP versions 4 and 5
- *
- * CakePHP : Rapid Development Framework <http://www.cakephp.org/>
- * Copyright (c) 2006, Cake Software Foundation, Inc.
- * 1785 E. Sahara Avenue, Suite 490-204
- * Las Vegas, Nevada 89104
- *
- * Licensed under The MIT License
- * Redistributions of files must retain the above copyright notice.
- *
- * @filesource
- * @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
- * @package cake
- * @subpackage cake.app.config
- * @since CakePHP v 0.2.9
- * @version $Revision: 296 $
- * @modifiedby $LastChangedBy: gwoo $
- * @lastmodified $Date: 2007-07-21 09:08:12 -0500 (Sat, 21 Jul 2007) $
- * @license http://www.opensource.org/licenses/mit-license.php The MIT License
- */
/**
* Here, we are connecting '/' (base path) to controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
@@ -46,12 +17,4 @@
Router::connect('/tags/*', array('controller' => 'tags', 'action' => 'show'));
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
-
Router::connect('/:controller/:action/:nick/*', array('controller' => 'pastes', 'action' => 'index', 'nick'=> null));
-
-/**
- * Then we connect url '/test' to our test controller. This is helpfull in
- * developement.
- */
- Router::connect('/tests', array('controller' => 'tests', 'action' => 'index'));
-?>
View
4 Controller/AppController.php
@@ -16,13 +16,13 @@ class AppController extends Controller {
var $layout = 'v3';
- function redirect($url, $status = null) {
+ function redirect($url, $status = null, $exit = true) {
if(is_array($url)) {
$url = Router::url($url);
}
$ajax = ($this->RequestHandler->isAjax())
? ($url{0} != '/') ? '/ajax/' : '/ajax' : null;
- parent::redirect($ajax.$url, $status);
+ parent::redirect($ajax.$url, $status, $exit);
}
}
View
12 Controller/PastesController.php
@@ -1,6 +1,6 @@
<?php
-App::uses('Utility', 'Sanitize');
-App::uses('Utility', 'Folder');
+App::uses('Sanitize', 'Utility');
+App::uses('Folder', 'Utility');
class PastesController extends AppController
{
@@ -13,7 +13,7 @@ class PastesController extends AppController
'limit'=>'40'
);
- var $components = array('Security');
+ var $components = array('Session', 'Security');
function _validatePost() {
if($this->request->action === 'edit'){
@@ -262,12 +262,12 @@ function __purge() {
function __languages() {
$names = array();
- if (!($Folder = new Folder(APP.'vendors'.DS.'geshi'))) {
- if (!($Folder = new Folder(ROOT . 'vendors' .DS. 'geshi'))) {
+ if (!($Folder = new Folder(APP.'Vendor'.DS.'geshi'))) {
+ if (!($Folder = new Folder(ROOT . 'Vendor' .DS. 'geshi'))) {
$names[] = 'No languages available!';
}
}
- $languages = $Folder->ls(true, true);
+ $languages = $Folder->read(true, true);
if(!empty($languages[1])) {
foreach($languages[1] as $lang) {
$names[substr($lang, 0, strlen($lang) - 4)] = substr($lang, 0, strlen($lang) - 4);
View
6 View/Elements/modify.ctp
@@ -27,8 +27,8 @@ endif;
<?php echo $this->Form->error('Paste.nick', 'Please enter a Nick.');?>
</div>
<div class="required">
- <?php echo $this->Form->label('NewPaste.lang', 'Language*');?>
- <?php echo $this->Form->select('NewPaste.lang', $languages, $this->Html->value('NewPaste.lang')) ?>
+ <?php echo $this->Form->label('NewPaste.lang', 'Language*'); ?>
+ <?php echo $this->Form->select('NewPaste.lang', $languages); ?>
<?php echo $this->Form->error('Paste.lang', 'Please enter the Language.');?>
</div>
<div class="optional">
@@ -50,4 +50,4 @@ endif;
<?php echo $this->Form->submit('Submit');?>
</div>
<?php echo $this->Form->end();?>
-</div>
+</div>
View
5 View/Helper/CakebinHelper.php
@@ -2,7 +2,8 @@
class CakebinHelper extends Helper {
var $helpers = array('Text');
-
+ var $Geshi;
+
function init($lang = 'php') {
App::import('Vendor', 'Geshi');
$this->Geshi = & new Geshi(null, null);
@@ -39,4 +40,4 @@ function aList($array) {
}
return false;
}
-}
+}
View
6 View/Pastes/add.ctp
@@ -1,6 +1,6 @@
-<?php echo $this->Form->create('Paste', array('action'=>'add'));?>
+<?php echo $this->Form->create('Paste', array('action' => 'add'));?>
<div class="left">
- <div class="required">
+ <div class="required">
<?php echo $this->Form->error('Paste.body', 'Please enter the body.');?>
<?php echo $this->Form->textarea('NewPaste.body', array('value'=> $this->Cakebin->htmldecode($this->Html->value('NewPaste.body')),'cols' => '70', 'rows' => '26'));?>
</div>
@@ -14,7 +14,7 @@
</div>
<div class="required">
<?php echo $this->Form->label('NewPaste.lang', 'Language*');?>
- <?php echo $this->Form->select('NewPaste.lang', $languages, $this->Html->value('NewPaste.lang')) ?>
+ <?php echo $this->Form->select('NewPaste.lang', $languages); ?>
<?php echo $this->Form->error('Paste.lang', 'Please enter the Language.');?>
</div>
<div class="optional">
View
0 tmp/cache/models/empty 100644 → 100755
File mode changed.
View
0 tmp/cache/persistent/empty 100644 → 100755
File mode changed.

0 comments on commit a40efc1

Please sign in to comment.