Browse Source

Correct assets.

Mark Scherer 10 years ago
parent
commit
2965a152a8

+ 22 - 0
Console/Command/MyShell.php

@@ -0,0 +1,22 @@
+<?php
+
+App::uses('Shell', 'Console');
+
+/**
+ */
+class MyShell extends Shell {
+
+	/**
+	 * MyShell::name()
+	 *
+	 * @param bool $prependPlugin
+	 * @return string
+	 */
+	public function name($prependPlugin = true) {
+		$plugin = '';
+
+		$name = $plugin . $this->name;
+		return $name;
+	}
+
+}

+ 1 - 1
Controller/Component/CommonComponent.php

@@ -85,7 +85,7 @@ class CommonComponent extends Component {
 			$this->Session->delete('Message');
 		}
 
-		if ($this->Controller->request->is('ajax')) {
+		if (isset($this->Controller->request) && $this->Controller->request->is('ajax')) {
 			$ajaxMessages = array_merge(
 				(array)$this->Session->read('messages'),
 				(array)Configure::read('messages')

+ 1 - 1
Controller/Component/FlashComponent.php

@@ -76,7 +76,7 @@ class FlashComponent extends Component {
 			$this->Session->delete('Message');
 		}
 
-		if ($this->settings['headerOnAjax'] && $this->Controller->request->is('ajax')) {
+		if ($this->settings['headerOnAjax'] && isset($this->Controller->request) && $this->Controller->request->is('ajax')) {
 			$ajaxMessages = array_merge(
 				(array)$this->Session->read('messages'),
 				(array)Configure::read('messages')

+ 22 - 0
Test/Case/Model/LogTest.php

@@ -0,0 +1,22 @@
+<?php
+
+App::uses('Log', 'Tools.Model');
+App::uses('MyCakeTestCase', 'Tools.TestSuite');
+
+class LogTest extends MyCakeTestCase {
+
+	public $Log;
+
+	public function setUp() {
+		parent::setUp();
+
+		$this->Log = new Log();
+	}
+
+	public function testObject() {
+		$this->assertTrue(is_object($this->Log));
+		$this->assertInstanceOf('Log', $this->Log);
+	}
+
+	//TODO
+}

+ 0 - 157
Test/Fixture/LogIpFixture.php

@@ -1,157 +0,0 @@
-<?php
-/* LogIp Fixture generated on: 2011-11-20 21:59:09 : 1321822749 */
-
-/**
- * LogIpFixture
- *
- */
-class LogIpFixture extends CakeTestFixture {
-
-	/**
-	 * Fields
-	 *
-	 * @var array
-	 */
-	public $fields = [
-		'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''],
-		'ip' => ['type' => 'string', 'null' => false, 'default' => null, 'length' => 39, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '15chars=IPv4, 39chars=IPv6', 'charset' => 'utf8'],
-		'referer' => ['type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'],
-		'host' => ['type' => 'string', 'null' => false, 'default' => null, 'length' => 128, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'],
-		'agent' => ['type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'browser', 'charset' => 'utf8'],
-		'user_id' => ['type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'],
-		'lat' => ['type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''],
-		'lng' => ['type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''],
-		'city' => ['type' => 'string', 'null' => false, 'default' => null, 'length' => 60, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'],
-		'created' => ['type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => 'each ip is only valid for a few hours'],
-		'indexes' => ['PRIMARY' => ['column' => 'id', 'unique' => 1], 'user_id' => ['column' => 'user_id', 'unique' => 0], 'ip' => ['column' => 'ip', 'unique' => 0]],
-		'tableParameters' => []
-	];
-
-	/**
-	 * Records
-	 *
-	 * @var array
-	 */
-	public $records = [
-		[
-			'id' => '163',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30',
-			'user_id' => null,
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-07-17 14:14:15'
-		],
-		[
-			'id' => '164',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30',
-			'user_id' => null,
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-07-23 11:59:48'
-		],
-		[
-			'id' => '165',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30',
-			'user_id' => null,
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-07-26 02:17:14'
-		],
-		[
-			'id' => '166',
-			'ip' => '127.0.0.1',
-			'referer' => 'http://ordofood/login',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30',
-			'user_id' => '14',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-08-07 15:26:13'
-		],
-		[
-			'id' => '167',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-08-10 20:21:15'
-		],
-		[
-			'id' => '168',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-08-12 19:14:53'
-		],
-		[
-			'id' => '169',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-08-18 23:18:28'
-		],
-		[
-			'id' => '170',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-08-23 17:59:35'
-		],
-		[
-			'id' => '171',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-09-16 10:19:34'
-		],
-		[
-			'id' => '172',
-			'ip' => '127.0.0.1',
-			'referer' => '',
-			'host' => 'marknb',
-			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1',
-			'user_id' => '',
-			'lat' => '0.000000',
-			'lng' => '0.000000',
-			'city' => '',
-			'created' => '2011-09-23 10:18:43'
-		],
-	];
-}

+ 5 - 5
View/Helper/FormExtHelper.php

@@ -532,8 +532,8 @@ class FormExtHelper extends FormShimHelper {
 							$this->Html->script('datepicker/datepicker', false);
 							$this->Html->css('common/datepicker', ['inline' => false]);
 						} else {
-							$this->Common->script(['Tools.Asset|datepicker/lang/' . $lang, 'Tools.Asset|datepicker/datepicker'], false);
-							$this->Common->css(['Tools.Asset|datepicker/datepicker'], ['inline' => false]);
+							$this->Common->script(['ToolsExtra.Asset|datepicker/lang/' . $lang, 'ToolsExtra.Asset|datepicker/datepicker'], false);
+							$this->Common->css(['ToolsExtra.Asset|datepicker/datepicker'], ['inline' => false]);
 						}
 						$this->scriptsAdded['date'] = true;
 						break;
@@ -541,9 +541,9 @@ class FormExtHelper extends FormShimHelper {
 						continue;
 						if ($this->settings['webroot']) {
 						} else {
-							//'Tools.Jquery|ui/core/jquery.ui.core', 'Tools.Jquery|ui/core/jquery.ui.widget', 'Tools.Jquery|ui/widgets/jquery.ui.slider',
-							$this->Common->script(['Tools.Jquery|plugins/jquery.timepicker.core', 'Tools.Jquery|plugins/jquery.timepicker'], false);
-							$this->Common->css(['Tools.Jquery|ui/core/jquery.ui', 'Tools.Jquery|plugins/jquery.timepicker'], ['inline' => false]);
+							//'ToolsExtra.Jquery|ui/core/jquery.ui.core', 'ToolsExtra.Jquery|ui/core/jquery.ui.widget', 'ToolsExtra.Jquery|ui/widgets/jquery.ui.slider',
+							$this->Common->script(['ToolsExtra.Jquery|plugins/jquery.timepicker.core', 'ToolsExtra.Jquery|plugins/jquery.timepicker'], false);
+							$this->Common->css(['ToolsExtra.Jquery|ui/core/jquery.ui', 'ToolsExtra.Jquery|plugins/jquery.timepicker'], ['inline' => false]);
 						}
 						break;
 					default: