├── View ├── Users │ ├── login.ctp │ └── login_form.ctp ├── Helper │ ├── BootstrapSessionHelper.php │ ├── BootstrapFormHelper.php │ └── BootstrapPaginatorHelper.php ├── Admin │ └── index.ctp ├── Scaffolds │ ├── form.ctp │ ├── index.ctp │ └── view.ctp └── Layouts │ └── default.ctp ├── webroot ├── img │ ├── loading.gif │ ├── cross_red.png │ ├── check_yellow.png │ └── admin_icons │ │ ├── ark.png │ │ ├── fav.png │ │ ├── flw.png │ │ ├── spa.png │ │ ├── tip.png │ │ ├── album.png │ │ ├── bell.png │ │ ├── blog.png │ │ ├── cache.png │ │ ├── calc.png │ │ ├── chat.png │ │ ├── date.png │ │ ├── demo.png │ │ ├── fish.png │ │ ├── flash.png │ │ ├── games.png │ │ ├── globe.png │ │ ├── gnome.png │ │ ├── gold.png │ │ ├── java.png │ │ ├── mail.png │ │ ├── menu.png │ │ ├── mymac.png │ │ ├── news.png │ │ ├── notes.png │ │ ├── page.png │ │ ├── photo.png │ │ ├── room.png │ │ ├── space.png │ │ ├── star.png │ │ ├── trash.png │ │ ├── user.png │ │ ├── view.png │ │ ├── virus.png │ │ ├── wifi.png │ │ ├── banner.png │ │ ├── binary.png │ │ ├── camera.png │ │ ├── category.png │ │ ├── colors.png │ │ ├── dining.png │ │ ├── dinning.png │ │ ├── keyboard.png │ │ ├── monitor.png │ │ ├── packag.png │ │ ├── package.png │ │ ├── resort.png │ │ ├── restart.png │ │ ├── safari.png │ │ ├── services.png │ │ ├── wallet.png │ │ ├── wizard.png │ │ ├── assistant.png │ │ ├── background.png │ │ ├── categories.png │ │ ├── education.png │ │ ├── filesystem.png │ │ ├── folder_tar.png │ │ ├── important.png │ │ ├── mycomputer.png │ │ ├── recreation.png │ │ ├── telescope.png │ │ ├── utilities.png │ │ ├── blockdevice.png │ │ ├── communityhelp.png │ │ ├── destination.png │ │ ├── destinations.png │ │ ├── filemanager.png │ │ ├── sharemanager.png │ │ ├── volumemanager.png │ │ └── .comments │ │ └── 4square.png.xml ├── js │ ├── scripts.js │ ├── bootstrap-datepicker.js │ ├── advanced.js │ ├── bootstrap.min.js │ └── bootstrap-wysihtml5-0.0.2.js └── css │ ├── wysiwyg-color.css │ ├── styles.css │ ├── bootstrap-wysihtml5.css │ ├── bootstrap-wysihtml5-0.0.2.css │ ├── datepicker.css │ └── jquery.dataTables.css ├── .gitignore ├── Model ├── UserModel.php └── AdminAppModel.php ├── Controller ├── AdminController.php ├── UsersController.php └── AdminAppController.php ├── Config └── bootstrap.php └── README.md /View/Users/login.ctp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webroot/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/loading.gif -------------------------------------------------------------------------------- /webroot/img/cross_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/cross_red.png -------------------------------------------------------------------------------- /webroot/img/check_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/check_yellow.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/ark.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/fav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/fav.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/flw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/flw.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/spa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/spa.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/tip.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/album.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/bell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/bell.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/blog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/blog.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/cache.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/calc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/calc.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/chat.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/date.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/demo.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/fish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/fish.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/flash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/flash.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/games.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/games.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/globe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/globe.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/gnome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/gnome.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/gold.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/java.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/java.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/mail.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/menu.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/mymac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/mymac.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/news.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/notes.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/page.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/photo.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/room.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/room.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/space.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/star.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/trash.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/user.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/view.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/virus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/virus.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/wifi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/wifi.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/banner.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/binary.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/camera.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/category.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/colors.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/dining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/dining.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/dinning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/dinning.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/keyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/keyboard.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/monitor.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/packag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/packag.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/package.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/resort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/resort.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/restart.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/safari.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/services.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/services.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/wallet.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/wizard.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/assistant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/assistant.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/background.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/categories.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/education.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/education.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/filesystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/filesystem.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/folder_tar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/folder_tar.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/important.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/mycomputer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/mycomputer.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/recreation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/recreation.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/telescope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/telescope.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/utilities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/utilities.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/blockdevice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/blockdevice.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/communityhelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/communityhelp.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/destination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/destination.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/destinations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/destinations.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/filemanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/filemanager.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/sharemanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/sharemanager.png -------------------------------------------------------------------------------- /webroot/img/admin_icons/volumemanager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Maldicore/Admin/HEAD/webroot/img/admin_icons/volumemanager.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/* 2 | [Cc]onfig/core.php 3 | [Cc]onfig/database.php 4 | app/tmp/* 5 | app/[Cc]onfig/core.php 6 | app/[Cc]onfig/database.php 7 | !empty -------------------------------------------------------------------------------- /webroot/img/admin_icons/.comments/4square.png.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | glyphicons 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /View/Users/login_form.ctp: -------------------------------------------------------------------------------- 1 | Session->flash(); 3 | echo $this->BSForm->create('User', array( 'controller' => 'Users', 'action' => 'login' ) ); 4 | echo $this->BSForm->input('username'); 5 | echo $this->BSForm->input('password'); 6 | echo $this->BSForm->end('Login'); 7 | ?> -------------------------------------------------------------------------------- /Model/UserModel.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | class User extends AppModel { 16 | 17 | } 18 | ?> -------------------------------------------------------------------------------- /Model/AdminAppModel.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('AppModel', 'Model'); 17 | 18 | class AdminAppModel extends AppModel 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /webroot/js/scripts.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('.wysihtml').wysihtml5({ 3 | "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true 4 | "emphasis": true, //Italics, bold, etc. Default true 5 | "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true 6 | "html": true, //Button which allows you to edit the generated HTML. Default false 7 | "link": true, //Button to insert a link. Default true 8 | "image": true, //Button to insert an image. Default true, 9 | "color": true //Button to change color of font 10 | }); 11 | $('.datepicker').datepicker({ 12 | format: 'yyyy-mm-dd' 13 | }); 14 | }); -------------------------------------------------------------------------------- /Controller/AdminController.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('AdminAppController', 'Admin.Controller'); 17 | 18 | class AdminController extends AdminAppController 19 | { 20 | /** 21 | * Uses 22 | * 23 | * @var mixed 24 | */ 25 | public $uses = null; 26 | 27 | /** 28 | * Index 29 | * 30 | * @return void 31 | */ 32 | public function index() 33 | { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /View/Helper/BootstrapSessionHelper.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('SessionHelper', 'View/Helper'); 17 | 18 | class BootstrapSessionHelper extends SessionHelper 19 | { 20 | /** 21 | * Flash 22 | * 23 | * @param $key string 24 | * @param $attrs array 25 | * @return string 26 | */ 27 | public function flash($key = 'flash', $attrs = array()) 28 | { 29 | if (empty($attrs['params']['class'])) { 30 | $attrs['params']['class'] = 'alert'; 31 | } 32 | return parent::flash($key, $attrs); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /webroot/css/wysiwyg-color.css: -------------------------------------------------------------------------------- 1 | .wysiwyg-color-black { 2 | color: black; 3 | } 4 | 5 | .wysiwyg-color-silver { 6 | color: silver; 7 | } 8 | 9 | .wysiwyg-color-gray { 10 | color: gray; 11 | } 12 | 13 | .wysiwyg-color-white { 14 | color: white; 15 | } 16 | 17 | .wysiwyg-color-maroon { 18 | color: maroon; 19 | } 20 | 21 | .wysiwyg-color-red { 22 | color: red; 23 | } 24 | 25 | .wysiwyg-color-purple { 26 | color: purple; 27 | } 28 | 29 | .wysiwyg-color-fuchsia { 30 | color: fuchsia; 31 | } 32 | 33 | .wysiwyg-color-green { 34 | color: green; 35 | } 36 | 37 | .wysiwyg-color-lime { 38 | color: lime; 39 | } 40 | 41 | .wysiwyg-color-olive { 42 | color: olive; 43 | } 44 | 45 | .wysiwyg-color-yellow { 46 | color: yellow; 47 | } 48 | 49 | .wysiwyg-color-navy { 50 | color: navy; 51 | } 52 | 53 | .wysiwyg-color-blue { 54 | color: blue; 55 | } 56 | 57 | .wysiwyg-color-teal { 58 | color: teal; 59 | } 60 | 61 | .wysiwyg-color-aqua { 62 | color: aqua; 63 | } 64 | 65 | .wysiwyg-color-orange { 66 | color: orange; 67 | } -------------------------------------------------------------------------------- /View/Admin/index.ctp: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | ?> 16 | 27 | -------------------------------------------------------------------------------- /Controller/UsersController.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('AdminAppController', 'Admin.Controller'); 17 | App::uses('AppController', 'Controller'); 18 | 19 | class UsersController extends AdminAppController { 20 | var $name = 'Users'; 21 | var $helpers = array('Form'); 22 | 23 | function login_form() { 24 | 25 | } 26 | 27 | function login() { 28 | 29 | if (empty($this->data['User']['username']) == false) { 30 | 31 | $user = $this->User->find('all', array('conditions' => array('User.username' => $this->data['User']['username'], 'User.password' =>md5($this->data['User']['password'])))); 32 | if($user != false) { 33 | $this->Session->setFlash('Thank you for logging in!'); 34 | $this->Session->write('User', $user); 35 | $this->Redirect(array('controller' => '', 'action' => 'index')); 36 | exit(); 37 | } else { 38 | $this -> Session -> setFlash('Incorrect username/password!', true); 39 | $this -> Redirect(array('action' => 'login_form')); 40 | exit(); 41 | } 42 | } 43 | } 44 | 45 | function logout() { 46 | 47 | $this -> Session -> destroy(); 48 | $this -> Session -> setFlash('You have been logged out!'); 49 | 50 | $this -> Redirect(array('action' => 'login_form')); 51 | exit(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Config/bootstrap.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | // App::uses('ConnectionManager', 'Model'); 17 | App::uses('Inflector', 'Utility'); 18 | App::uses('ClassRegistry', 'Utility'); 19 | App::uses('CakeRequest', 'Network'); 20 | 21 | $adminIsAuthorized = (function_exists('adminIsAuthorized')) ? adminIsAuthorized() : true; 22 | if ($adminIsAuthorized === false) { 23 | throw new MethodNotAllowedException(); 24 | } 25 | 26 | $Request = new CakeRequest(); 27 | if (isset($Request->url)) { 28 | $parts = explode('/', $Request->url); 29 | 30 | $createCont = true; 31 | if(isset($parts[0])){ 32 | if(strtolower($parts[0]) == 'admin'){ 33 | $createCont = true; 34 | } else { 35 | $createCont = false; 36 | } 37 | } 38 | if(isset($parts[1])){ 39 | if(strtolower($parts[1]) == 'users' || strtolower($parts[1]) == 'admin'){ 40 | $createCont = false; 41 | } else { 42 | $createCont = true; 43 | } 44 | } 45 | if(isset($parts[2])){ 46 | if (strtolower($parts[2]) == 'login' || strtolower($parts[2]) == 'login_form' || strtolower($parts[2]) == 'logout') { 47 | $createCont = false; 48 | } else { 49 | $createCont = true; 50 | } 51 | } 52 | 53 | /* 54 | if (!$model->useTable) { 55 | // Model is not tied to a database table. 56 | return; 57 | } 58 | */ 59 | 60 | if($createCont){ 61 | if ((isset($parts[0])) && ($parts[0] == 'admin')) { 62 | if (isset($parts[1])) { 63 | $modelClassName = Inflector::camelize(Inflector::singularize($parts[1])); 64 | $Model = ClassRegistry::init($modelClassName); 65 | $DataSource = $Model->getDataSource(); 66 | $controllerClassName = Inflector::camelize($parts[1]) . 'Controller'; 67 | $controllerClass = 'App::uses(\'AdminAppController\',\'Admin.Controller\');class ' . $controllerClassName . ' extends AdminAppController{public $uses = \'' . $modelClassName . '\';}'; 68 | eval($controllerClass); 69 | } 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /webroot/css/styles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | padding-top:0px; 3 | } 4 | 5 | .sidebar-nav{ 6 | padding:9px 0; 7 | } 8 | 9 | textarea { 10 | width: 99%; 11 | height:150px; 12 | } 13 | 14 | #main-content{ 15 | float:left; 16 | position:relative; 17 | left:0px; 18 | } 19 | 20 | /* DataTable Styles */ 21 | div.dataTables_length label { 22 | float: left; 23 | text-align: left; 24 | } 25 | 26 | div.dataTables_length select { 27 | width: 75px; 28 | } 29 | 30 | div.dataTables_filter label { 31 | float: right; 32 | } 33 | 34 | div.dataTables_info { 35 | padding-top: 8px; 36 | } 37 | 38 | div.dataTables_paginate { 39 | float: right; 40 | margin: 0; 41 | } 42 | 43 | table { 44 | /* margin: 1em 0;*/ 45 | margin-bottom: 6px !important; 46 | clear: both; 47 | } 48 | 49 | table.table thead .sorting, 50 | table.table thead .sorting_asc, 51 | table.table thead .sorting_desc, 52 | table.table thead .sorting_asc_disabled, 53 | table.table thead .sorting_desc_disabled { 54 | cursor: pointer; 55 | *cursor: hand; 56 | } 57 | 58 | table.table thead .sorting { background: url('images/sort_both.png') no-repeat center right; } 59 | table.table thead .sorting_asc { background: url('images/sort_asc.png') no-repeat center right; } 60 | table.table thead .sorting_desc { background: url('images/sort_desc.png') no-repeat center right; } 61 | 62 | table.table thead .sorting_asc_disabled { background: url('images/sort_asc_disabled.png') no-repeat center right; } 63 | table.table thead .sorting_desc_disabled { background: url('images/sort_desc_disabled.png') no-repeat center right; } 64 | 65 | .nav-box li a{ 66 | border: solid 1px white; 67 | border-radius: 5px; 68 | box-shadow: 0 0 3px #AAA; 69 | background: #EFEFEF; 70 | width: 110px; 71 | height: 110px; 72 | text-align: center; 73 | float: left; 74 | margin: 10px; 75 | } 76 | 77 | .nav-box li a:hover{ 78 | box-shadow: 0px 3px 10px #000; 79 | } 80 | 81 | .control-group label{ 82 | min-width: 15%; 83 | display: inline-block; 84 | } 85 | /* Mouse Over Text */ 86 | td.info{ 87 | position:relative; /*this is the key*/ 88 | color:#000; 89 | text-decoration:none; 90 | } 91 | 92 | td.info span{display: none} 93 | 94 | td.info:hover span{ /*display just on :hover state*/ 95 | display:block; 96 | position:absolute; 97 | top:-60px; 98 | width:350%; 99 | border:5px solid #0cf; 100 | background-color:#cff; color:#000; 101 | text-align: center; 102 | padding:10px; 103 | z-index: 9999; 104 | } -------------------------------------------------------------------------------- /View/Scaffolds/form.ctp: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | ?> 16 |
17 |
18 |
19 | 20 | 36 |
37 |
38 |
39 | Session->flash(); ?> 40 | BSForm->create($modelClass); ?> 41 | BSForm->inputs($scaffoldFields, array('created', 'modified', 'updated')); ?> 42 | BSForm->end(__d('cake', 'Save')); ?> 43 |
44 |
45 | -------------------------------------------------------------------------------- /webroot/css/bootstrap-wysihtml5.css: -------------------------------------------------------------------------------- 1 | ul.wysihtml5-toolbar { 2 | margin: 0; 3 | padding: 0; 4 | display: block; 5 | } 6 | 7 | ul.wysihtml5-toolbar::after { 8 | clear: both; 9 | display: table; 10 | content: ""; 11 | } 12 | 13 | ul.wysihtml5-toolbar > li { 14 | float: left; 15 | display: list-item; 16 | list-style: none; 17 | margin: 0 5px 10px 0; 18 | } 19 | 20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { 21 | font-weight: bold; 22 | } 23 | 24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { 25 | font-style: italic; 26 | } 27 | 28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { 29 | text-decoration: underline; 30 | } 31 | 32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { 33 | background-image: none; 34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 37 | background-color: #E6E6E6; 38 | background-color: #D9D9D9; 39 | outline: 0; 40 | } 41 | 42 | ul.wysihtml5-commands-disabled .dropdown-menu { 43 | display: none !important; 44 | } 45 | 46 | ul.wysihtml5-toolbar div.wysihtml5-colors { 47 | display:block; 48 | width: 50px; 49 | height: 20px; 50 | margin-top: 2px; 51 | margin-left: 5px; 52 | position: absolute; 53 | pointer-events: none; 54 | } 55 | 56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title { 57 | padding-left: 70px; 58 | } 59 | 60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { 61 | background: black !important; 62 | } 63 | 64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { 65 | background: silver !important; 66 | } 67 | 68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { 69 | background: gray !important; 70 | } 71 | 72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { 73 | background: maroon !important; 74 | } 75 | 76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { 77 | background: red !important; 78 | } 79 | 80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { 81 | background: purple !important; 82 | } 83 | 84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { 85 | background: green !important; 86 | } 87 | 88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { 89 | background: olive !important; 90 | } 91 | 92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { 93 | background: navy !important; 94 | } 95 | 96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { 97 | background: blue !important; 98 | } 99 | 100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { 101 | background: orange !important; 102 | } -------------------------------------------------------------------------------- /webroot/css/bootstrap-wysihtml5-0.0.2.css: -------------------------------------------------------------------------------- 1 | ul.wysihtml5-toolbar { 2 | margin: 0; 3 | padding: 0; 4 | display: block; 5 | } 6 | 7 | ul.wysihtml5-toolbar::after { 8 | clear: both; 9 | display: table; 10 | content: ""; 11 | } 12 | 13 | ul.wysihtml5-toolbar > li { 14 | float: left; 15 | display: list-item; 16 | list-style: none; 17 | margin: 0 5px 10px 0; 18 | } 19 | 20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] { 21 | font-weight: bold; 22 | } 23 | 24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] { 25 | font-style: italic; 26 | } 27 | 28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] { 29 | text-decoration: underline; 30 | } 31 | 32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active { 33 | background-image: none; 34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05); 37 | background-color: #E6E6E6; 38 | background-color: #D9D9D9; 39 | outline: 0; 40 | } 41 | 42 | ul.wysihtml5-commands-disabled .dropdown-menu { 43 | display: none !important; 44 | } 45 | 46 | ul.wysihtml5-toolbar div.wysihtml5-colors { 47 | display:block; 48 | width: 50px; 49 | height: 20px; 50 | margin-top: 2px; 51 | margin-left: 5px; 52 | position: absolute; 53 | pointer-events: none; 54 | } 55 | 56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title { 57 | padding-left: 70px; 58 | } 59 | 60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] { 61 | background: black !important; 62 | } 63 | 64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] { 65 | background: silver !important; 66 | } 67 | 68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] { 69 | background: gray !important; 70 | } 71 | 72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] { 73 | background: maroon !important; 74 | } 75 | 76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] { 77 | background: red !important; 78 | } 79 | 80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] { 81 | background: purple !important; 82 | } 83 | 84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] { 85 | background: green !important; 86 | } 87 | 88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] { 89 | background: olive !important; 90 | } 91 | 92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] { 93 | background: navy !important; 94 | } 95 | 96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] { 97 | background: blue !important; 98 | } 99 | 100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] { 101 | background: orange !important; 102 | } -------------------------------------------------------------------------------- /webroot/css/datepicker.css: -------------------------------------------------------------------------------- 1 | /* 2 | Datepicker for Bootstrap 3 | Copyright 2012 Stefan Petre 4 | Licensed under the Apache License v2.0 5 | http://www.apache.org/licenses/LICENSE-2.0 6 | */ 7 | .datepicker { top: 0; left: 0; padding: 4px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; /*.dow { border-top: 1px solid #ddd !important; }*/ } .datepicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .datepicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .datepicker > div { display: none; } .datepicker table { width: 100%; margin: 0; } .datepicker td, .datepicker th { text-align: center; width: 20px; height: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td.day:hover { background: #eeeeee; cursor: pointer; } .datepicker td.old, .datepicker td.new { color: #999999; } .datepicker td.active, .datepicker td.active:hover { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { background-color: #0044cc; } .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { background-color: #003399 \9; } .datepicker td span { display: block; width: 47px; height: 54px; line-height: 54px; float: left; margin: 2px; cursor: pointer; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td span:hover { background: #eeeeee; } .datepicker td span.active { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { background-color: #0044cc; } .datepicker td span.active:active, .datepicker td span.active.active { background-color: #003399 \9; } .datepicker td span.old { color: #999999; } .datepicker th.switch { width: 145px; } .datepicker th.next, .datepicker th.prev { font-size: 19.5px; } .datepicker thead tr:first-child th { cursor: pointer; } .datepicker thead tr:first-child th:hover { background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; } -------------------------------------------------------------------------------- /webroot/css/jquery.dataTables.css: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Table 4 | */ 5 | table.dataTable { 6 | margin: 0 auto; 7 | clear: both; 8 | width: 100%; 9 | } 10 | 11 | table.dataTable thead th { 12 | padding: 3px 18px 3px 10px; 13 | border-bottom: 1px solid black; 14 | font-weight: bold; 15 | cursor: pointer; 16 | *cursor: hand; 17 | } 18 | 19 | table.dataTable tfoot th { 20 | padding: 3px 18px 3px 10px; 21 | border-top: 1px solid black; 22 | font-weight: bold; 23 | } 24 | 25 | table.dataTable td { 26 | padding: 3px 10px; 27 | } 28 | 29 | table.dataTable td.center, 30 | table.dataTable td.dataTables_empty { 31 | text-align: center; 32 | } 33 | 34 | table.dataTable tr.odd { background-color: #E2E4FF; } 35 | table.dataTable tr.even { background-color: white; } 36 | 37 | table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; } 38 | table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; } 39 | table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; } 40 | table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; } 41 | table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; } 42 | table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; } 43 | 44 | 45 | /* 46 | * Table wrapper 47 | */ 48 | .dataTables_wrapper { 49 | position: relative; 50 | clear: both; 51 | *zoom: 1; 52 | } 53 | 54 | 55 | /* 56 | * Page length menu 57 | */ 58 | .dataTables_length { 59 | float: left; 60 | } 61 | 62 | 63 | /* 64 | * Filter 65 | */ 66 | .dataTables_filter { 67 | float: right; 68 | text-align: right; 69 | } 70 | 71 | 72 | /* 73 | * Table information 74 | */ 75 | .dataTables_info { 76 | clear: both; 77 | float: left; 78 | } 79 | 80 | 81 | /* 82 | * Pagination 83 | */ 84 | .dataTables_paginate { 85 | float: right; 86 | text-align: right; 87 | } 88 | 89 | /* Two button pagination - previous / next */ 90 | .paginate_disabled_previous, 91 | .paginate_enabled_previous, 92 | .paginate_disabled_next, 93 | .paginate_enabled_next { 94 | height: 19px; 95 | float: left; 96 | cursor: pointer; 97 | *cursor: hand; 98 | color: #111 !important; 99 | } 100 | .paginate_disabled_previous:hover, 101 | .paginate_enabled_previous:hover, 102 | .paginate_disabled_next:hover, 103 | .paginate_enabled_next:hover { 104 | text-decoration: none !important; 105 | } 106 | .paginate_disabled_previous:active, 107 | .paginate_enabled_previous:active, 108 | .paginate_disabled_next:active, 109 | .paginate_enabled_next:active { 110 | outline: none; 111 | } 112 | 113 | .paginate_disabled_previous, 114 | .paginate_disabled_next { 115 | color: #666 !important; 116 | } 117 | .paginate_disabled_previous, 118 | .paginate_enabled_previous { 119 | padding-left: 23px; 120 | } 121 | .paginate_disabled_next, 122 | .paginate_enabled_next { 123 | padding-right: 23px; 124 | margin-left: 10px; 125 | } 126 | 127 | .paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } 128 | .paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } 129 | .paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } 130 | 131 | .paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } 132 | .paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } 133 | .paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } 134 | 135 | /* Full number pagination */ 136 | .paging_full_numbers { 137 | height: 22px; 138 | line-height: 22px; 139 | } 140 | .paging_full_numbers a:active { 141 | outline: none 142 | } 143 | .paging_full_numbers a:hover { 144 | text-decoration: none; 145 | } 146 | 147 | .paging_full_numbers a.paginate_button, 148 | .paging_full_numbers a.paginate_active { 149 | border: 1px solid #aaa; 150 | -webkit-border-radius: 5px; 151 | -moz-border-radius: 5px; 152 | border-radius: 5px; 153 | padding: 2px 5px; 154 | margin: 0 3px; 155 | cursor: pointer; 156 | *cursor: hand; 157 | color: #333 !important; 158 | } 159 | 160 | .paging_full_numbers a.paginate_button { 161 | background-color: #ddd; 162 | } 163 | 164 | .paging_full_numbers a.paginate_button:hover { 165 | background-color: #ccc; 166 | text-decoration: none !important; 167 | } 168 | 169 | .paging_full_numbers a.paginate_active { 170 | background-color: #99B3FF; 171 | } 172 | 173 | 174 | /* 175 | * Processing indicator 176 | */ 177 | .dataTables_processing { 178 | position: absolute; 179 | top: 50%; 180 | left: 50%; 181 | width: 250px; 182 | height: 30px; 183 | margin-left: -125px; 184 | margin-top: -15px; 185 | padding: 14px 0 2px 0; 186 | border: 1px solid #ddd; 187 | text-align: center; 188 | color: #999; 189 | font-size: 14px; 190 | background-color: white; 191 | } 192 | 193 | 194 | /* 195 | * Sorting 196 | */ 197 | .sorting { background: url('../images/sort_both.png') no-repeat center right; } 198 | .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } 199 | .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } 200 | 201 | .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } 202 | .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } 203 | 204 | table.dataTable thead th:active, 205 | table.dataTable thead td:active { 206 | outline: none; 207 | } 208 | 209 | 210 | /* 211 | * Scrolling 212 | */ 213 | .dataTables_scroll { 214 | clear: both; 215 | } 216 | 217 | .dataTables_scrollBody { 218 | *margin-top: -1px; 219 | -webkit-overflow-scrolling: touch; 220 | } 221 | 222 | -------------------------------------------------------------------------------- /View/Layouts/default.ctp: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | ?> 16 | 17 | 18 | 19 | 20 | <?php echo isset($pluralHumanName) ? str_replace('Admin ', '', $pluralHumanName) . ' - ' : '' ?><?php echo __('Admin'); ?> 21 | 22 | 23 | Html->css('/Admin/css/bootstrap-wysihtml5-0.0.2'); ?> 24 | Html->css('/Admin/css/datepicker'); ?> 25 | Html->css('/Admin/css/styles'); ?> 26 | 27 | 28 | Html->script('/Admin/js/advanced'); ?> 29 | Html->script('/Admin/js/wysihtml5-0.3.0_rc2'); ?> 30 | Html->script('/Admin/js/bootstrap.min'); ?> 31 | Html->script('/Admin/js/bootstrap-wysihtml5-0.0.2'); ?> 32 | Html->script('/Admin/js/bootstrap-datepicker'); ?> 33 | Html->script('/Admin/js/jquery.dataTables'); ?> 34 | Html->script('/Admin/js/scripts'); ?> 35 | 38 | Html->meta('icon'); ?> 39 | 40 | 41 | 92 |
93 |
94 | fetch('content'); ?> 95 |
96 |
97 |
98 | element('sql_dump')); ?> 99 | 100 |

Powered by: CakePHP Admin Plugin

101 |
102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /View/Helper/BootstrapFormHelper.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('FormHelper', 'View/Helper'); 17 | 18 | class BootstrapFormHelper extends FormHelper 19 | { 20 | /** 21 | * Create 22 | * 23 | * @param $model string 24 | * @param $options array 25 | * @return string 26 | */ 27 | public function create($model = null, $options = array()) 28 | { 29 | if (empty($options['class'])) { 30 | $options['class'] = 'well'; 31 | } 32 | 33 | $modelKey = $this->model(); 34 | $Model = ClassRegistry::init($modelKey); 35 | if(!empty($Model->displayFieldTypes[$modelKey])){ 36 | if(in_array('image', $Model->displayFieldTypes[$modelKey]) || in_array('file',$Model->displayFieldTypes[$modelKey])){ 37 | $type_val = array('type'=>'file'); 38 | $options = array_merge($type_val, $options); 39 | } 40 | } 41 | 42 | return parent::create($model, $options); 43 | } 44 | 45 | /** 46 | * Input 47 | * 48 | * @param $fieldName string 49 | * @param $options array 50 | * @return string 51 | */ 52 | public function input($fieldName, $options = array()) 53 | { 54 | $this->setEntity($fieldName); 55 | $defaults = array( 56 | 'format' => array( 57 | 'before', 58 | 'label', 59 | 'between', 60 | 'input', 61 | 'error', 62 | 'after' 63 | ), 64 | 'div' => array( 65 | 'class' => 'control-group' 66 | ), 67 | 'error' => array( 68 | 'attributes' => array( 69 | 'class' =>'help-inline', 70 | 'wrap' => 'span' 71 | ) 72 | ), 73 | 'help' => '', 74 | ); 75 | 76 | $modelKey = $this->model(); 77 | $fieldKey = $this->field(); 78 | $type = $this->_introspectModel($modelKey, 'fields', $fieldKey); 79 | $Model = ClassRegistry::init($modelKey); 80 | 81 | foreach ($Model->belongsTo as $bgOptions) { 82 | if($bgOptions['foreignKey']==$fieldKey){ 83 | $belongModel = new $bgOptions['className']; 84 | $options['options'] = $belongModel->find('list',array( 85 | 'conditions' => $bgOptions['conditions'], 86 | 'fields' => $bgOptions['fields'], 87 | 'order' => $bgOptions['order'], 88 | )); 89 | } 90 | } 91 | 92 | if($type['type'] == 'date'){ 93 | $type_val = array('class' => 'datepicker', 'type'=>'text'); 94 | $options = array_merge($type_val, $options); 95 | } 96 | if($type['type'] == 'timestamp'){ 97 | $type_val = array('class' => 'datepicker', 'type'=>'text'); 98 | $options = array_merge($type_val, $options); 99 | } 100 | if($type['type'] == 'datetime'){ 101 | $type_val = array('class' => 'datepicker', 'type'=>'text'); 102 | $options = array_merge($type_val, $options); 103 | } 104 | 105 | // debug($Model->displayFieldTypes); 106 | 107 | if(!empty($Model->displayFieldTypes)){ 108 | if (in_array($fieldKey, array_keys($Model->displayFieldTypes))){ 109 | if($Model->displayFieldTypes[$fieldKey] == 'wysihtml'){ 110 | $type_val = array('class' => 'wysihtml'); 111 | $options = array_merge($type_val, $options); 112 | } 113 | if($Model->displayFieldTypes[$fieldKey] == 'file'){ 114 | $type_val = array('class' => 'fileupload', 'type'=>'file'); 115 | $options = array_merge($type_val, $options); 116 | } 117 | if($Model->displayFieldTypes[$fieldKey] == 'image'){ 118 | $imagelink = ''; 119 | if(isset($this->data[$modelKey][$fieldKey]) && !empty($this->data[$modelKey][$fieldKey])){ 120 | $imagefile = $this->data[$modelKey][$fieldKey]; 121 | $fullpath = APP.'webroot'.DS.'img'.DS.$imagefile; 122 | if(file_exists($fullpath)){ 123 | $imagelink = " "; 124 | } 125 | } 126 | $type_val = array('class' => 'fileupload', 'between'=>$imagelink, 'type'=>'file'); 127 | $options = array_merge($type_val, $options); 128 | } 129 | } 130 | } 131 | 132 | $options = array_merge($defaults, $options); 133 | if (!empty($options['help'])) { 134 | $options['after'] = '' . $options['help'] . '' . $options['after']; 135 | } 136 | 137 | return parent::input($fieldName, $options); 138 | } 139 | 140 | /** 141 | * Submit 142 | * 143 | * @param $caption string 144 | * @return string 145 | */ 146 | public function submit($caption = null, $options = array()) 147 | { 148 | $options = array( 149 | 'class' => 'btn btn-primary' 150 | ); 151 | return parent::submit($caption, $options); 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CakePHP Admin Plugin 2 | 3 | CakePHP Plugin for automagic admin using Twitter Bootstrap. 4 | Version 1.0 for CakePHP 2.x 5 | 6 | This plugin uses the cake scaffolding to create admin panel automagically! 7 | 8 | ![Restore](https://lh4.googleusercontent.com/-OLACr5gkYLk/UNz5R4Vw-zI/AAAAAAAACYg/haHQDLNHYfI/s958/cakephpadmin.png) 9 | 10 | ## Installation 11 | 12 | 1. Copy or clone plugin to ``app/Plugin/Admin`` 13 | 1. Enable the plugin in ``app/Config/bootstrap.php`` !make sure to enable bootstrap true. 14 | Example code: 15 | ``` 16 | CakePlugin::load('Admin',array('bootstrap' => true)); 17 | ``` 18 | 3. The plugin uses CakePHP's Session Component, so if you haven't already, make sure it's added to ``app/Controller/AppController.php``. 19 | Example code: 20 | ``` 21 | public $components = array('Session'); 22 | ``` 23 | 24 | 25 | ## Database Tables 26 | 27 | Create the database tables 28 | 29 | ``` 30 | CREATE TABLE IF NOT EXISTS `users` ( 31 | `id` int(11) NOT NULL, 32 | `username` varchar(50) NOT NULL, 33 | `password` varchar(40) NOT NULL, 34 | `email` varchar(150) NOT NULL, 35 | `first_name` varchar(40) DEFAULT NULL, 36 | `middle_name` varchar(40) DEFAULT NULL, 37 | `last_name` varchar(40) DEFAULT NULL, 38 | `group_id` int(4) DEFAULT '4', 39 | `is_active` tinyint(1) DEFAULT '1', 40 | `created_date` datetime DEFAULT NULL, 41 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP 42 | ); 43 | 44 | -- 45 | -- Data for table `users` 46 | -- 47 | 48 | INSERT INTO `users` ( 49 | `id`, 50 | `username`, 51 | `password`, 52 | `email`, 53 | `first_name`, 54 | `middle_name`, 55 | `last_name`, 56 | `group_id`, 57 | `is_active`, 58 | `created_date`, 59 | `timestamp`) 60 | VALUES ( 61 | '1', 62 | 'admin', 63 | '21232f297a57a5a743894a0e4a801fc3', 64 | 'admin@admin.com', 65 | 'Admin', '', '', 66 | '1', 67 | '1', 68 | NULL, 69 | '' 70 | ); 71 | 72 | CREATE TABLE IF NOT EXISTS `groups` ( 73 | `id` int(11) NOT NULL AUTO_INCREMENT, 74 | `name` varchar(100) NOT NULL, 75 | `created` datetime DEFAULT NULL, 76 | `modified` datetime DEFAULT NULL, 77 | PRIMARY KEY (`id`) 78 | ); 79 | 80 | -- 81 | -- Data for table `groups` 82 | -- 83 | 84 | INSERT INTO `groups` (`id`, `name`, `created`, `modified`) VALUES 85 | ('1', 'administrators', '2012-07-05 17:16:24', '2012-07-05 17:16:24'), 86 | ('2', 'managers', '2012-07-05 17:16:34', '2012-07-05 17:16:34'), 87 | ('3', 'users', '2012-07-05 17:16:45', '2012-07-05 17:16:45'); 88 | ``` 89 | 90 | ## Usage/Quick Start 91 | 92 | 1. Go to ``http://site-url/admin`` 93 | 1. Login to your admin panel: Both username/password: ``admin`` 94 | 95 | NOTE: Make sure your table relationships are correctly set in the Models for dropdowns. 96 | 97 | ## Customization/Advanced Settings (not so advance though!) 98 | 99 | ### $displayFieldTypes 100 | You can define a variable $displayFieldTypes in any of the models to specify 101 | how the field should be displayed. This var accept a list of field names with the type 102 | of display, that includes: 103 | * wysihtml 104 | * image 105 | * file 106 | * checkbox 107 | 108 | The feature adds a class to the view field which is manipulated via javascript. 109 | 110 | example usage: 111 | ```php 112 | var $displayFieldTypes = array( 113 | 'introduction' => 'wysihtml', 114 | 'image' => 'image', 115 | 'image1' => 'image', 116 | 'image2' => 'image', 117 | 'image3' => 'image', 118 | 'image4' => 'image', 119 | 'is_active' => 'checkbox' 120 | ); 121 | ``` 122 | 123 | ##### wysihtml 124 | 125 | wysihtml uses https://github.com/jhollingworth/bootstrap-wysihtml5 and the wysihtml5 is initialized inside /app/Plugin/Admin/webroot/js/script.js 126 | 127 | You can change the toolbar features/buttons of wysihtml5 inside script.js: 128 | 129 | The defaults are: 130 | ```js 131 | $('.textarea').wysihtml5({ 132 | "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true 133 | "emphasis": true, //Italics, bold, etc. Default true 134 | "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true 135 | "html": false, //Button which allows you to edit the generated HTML. Default false 136 | "link": true, //Button to insert a link. Default true 137 | "image": true, //Button to insert an image. Default true, 138 | "color": false //Button to change color of font 139 | }); 140 | ``` 141 | For the font color to work on the front end make sure to include the color style file wysiwyg-color.css in your front end. 142 | 143 | ```php 144 | Html->css('/Admin/css/wysiwyg-color.css'); ?> 145 | ``` 146 | 147 | #### $upLoads 148 | 149 | You can define a variable $uploads in any of the models to specify upload path. 150 | Variable accepts two arrays imgDir & itemDir, imgDir can only be a string and itemDir can be a string or an array. 151 | The array should hold the name of the table field name which has the folder name 152 | 153 | example usage: 154 | ```php 155 | var $upLoads = array( 156 | 'imgDir' => 'library', 157 | 'itemDir' => array('field' => 'param_url'), 158 | ); 159 | ``` 160 | 161 | #### $ignoreFieldList 162 | 163 | You can define a variable $ignoreFieldList in any of the models to ignore fields from 164 | the list view. The list view can be huge at times with many unwanted fields, here you 165 | can give a list of fields to be ignored from the list view 166 | 167 | example usage: 168 | ```php 169 | var $ignoreFieldList = array( 170 | 'perm_url', 171 | 'commencing_date', 172 | 'termination_date', 173 | 'longitude', 174 | 'latitude', 175 | 'slogan', 176 | 'id', 177 | 'location', 178 | ); 179 | ``` 180 | 181 | ### $ignoreModelList 182 | 183 | You can define a variable $ignoreModelList in your application ``AppModel.php`` file 184 | inside model folder. The models are pursed from the application Model directory, 185 | some times you might have a model eg: a tableless model that you want to ignore. 186 | A list of models to be ignored can be defined in this variable $ignoreModelList 187 | 188 | example usage: 189 | ```php 190 | var $ignoreModelList = array( 191 | 'Country', 192 | ) 193 | ``` 194 | 195 | ### $adminSetting, array key icon 196 | 197 | #### Admin dashboard icons 198 | 199 | Admin dashboard icons can be customized using the $adminSetting variable inside 200 | each Model using an array with key value of 'icon'. EXCLUDE the extension '.png' 201 | All the files are stored in app/Plugin/Admin/webroot/img/admin_icons/ folder. 202 | If you do not specify an icon explicitly it will choose an icon from the folder 203 | in folder listing order. You can place an icon/image of .png inside this folder 204 | and explicitly define it in your model. 205 | 206 | example usage 207 | ```php 208 | var $adminSettings = array( 209 | 'icon' => 'blog', 210 | ); 211 | ``` 212 | ## Requirements 213 | 214 | PHP version: PHP 5.2+ 215 | CakePHP version: 2.1 216 | 217 | ## Support 218 | 219 | For support and feature request, please create an issue: 220 | https://github.com/Maldicore/Admin/issues 221 | 222 | We are not actively using this plugin as most of our current projects are done using Laravel. 223 | 224 | So support and development will be limited to as and when need and respect to time available. 225 | 226 | ## Contributing to this Plugin 227 | 228 | Please feel free to contribute to the plugin with new issues, requests, unit tests and code fixes or new features. 229 | 230 | If you want to develop, manage and continue supporting this plugin drop us an email info@maldicore.com 231 | 232 | Good Luck! 233 | 234 | ## License 235 | Copyright 2012, Maldicore Group Pvt Ltd 236 | 237 | Licensed under The MIT License: http://www.opensource.org/licenses/mit-license.php 238 | -------------------------------------------------------------------------------- /View/Scaffolds/index.ctp: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | ?> 16 |
17 |
18 |
19 | 20 | 33 |
34 |
35 |
36 |
37 |
38 | Session->flash(); ?> 39 | 42 | $value) { 45 | if(in_array($value, $ignoreFieldList)){ 46 | unset($toDisplayField[$key]); 47 | } 48 | } 49 | ?> 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | $_details): ?> 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | '.$this->Html->image($f_value, array('width' => '220')).''; 81 | } else { 82 | echo ''; 83 | } 84 | } 85 | if($displayFieldTypes[$modelClass][$_field] == 'checkbox'){ 86 | echo ''; 93 | } 94 | if($displayFieldTypes[$modelClass][$_field] == 'wysihtml'){ 95 | if(strlen($f_value) > 30){ 96 | echo ''; 97 | } else { 98 | echo ''; 99 | } 100 | } 101 | } else { 102 | if(strlen($f_value) > 30){ 103 | echo ''; 104 | } else { 105 | echo ''; 106 | } 107 | } 108 | ?> 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 |
Paginator->sort($_field); ?>
Html->link(${$singularVar}[$_alias][$_details['displayField']], array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])); ?>'.$f_value.' (image not found)'.''; 87 | if($f_value){ 88 | echo $this->html->image('/Admin/img/check_yellow.png'); 89 | } else { 90 | echo $this->html->image('/Admin/img/cross_red.png'); 91 | } 92 | echo ''.substr($f_value,0,30).''.$f_value.''.$f_value.''.substr($f_value,0,30).''.$f_value.''.$f_value.'Html->link(__d('cake', 'View'), array('plugin' => 'admin', 'action' => 'view', ${$singularVar}[$modelClass][$primaryKey]), array('class' => 'btn btn-info')); ?>Html->link(__d('cake', 'Edit'), array('plugin' => 'admin', 'action' => 'edit', ${$singularVar}[$modelClass][$primaryKey]), array('class' => 'btn btn-warning')); ?>BSForm->postLink(__d('cake', 'Delete'), array('plugin' => 'admin', 'action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), array('class' => 'btn btn-danger'), __d('cake', 'Are you sure you want to delete %s %s?', $modelClass, ${$singularVar}[$modelClass][$primaryKey])); ?>
118 |
119 | Paginator->counter(array('format' => __d('cake', 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}'))); ?> 120 |
121 | Paginator->numbers()): ?> 122 | 131 | 132 |
133 |
134 | -------------------------------------------------------------------------------- /View/Helper/BootstrapPaginatorHelper.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('PaginatorHelper', 'View/Helper'); 17 | 18 | class BootstrapPaginatorHelper extends PaginatorHelper 19 | { 20 | /** 21 | * Paging Link 22 | * 23 | * @param $which string 24 | * @param $title string 25 | * @param $options array 26 | * @param $disabledTitle string 27 | * @param $disabledOptions array 28 | * @return string 29 | */ 30 | protected function _pagingLink($which, $title = null, $options = array(), $disabledTitle = null, $disabledOptions = array()) 31 | { 32 | $check = 'has' . $which; 33 | $_defaults = array( 34 | 'url' => array(), 35 | 'step' => 1, 36 | 'escape' => false, 37 | 'model' => null, 38 | 'tag' => 'li', 39 | 'class' => null 40 | ); 41 | $options = array_merge($_defaults, (array)$options); 42 | $paging = $this->params($options['model']); 43 | if (empty($disabledOptions)) { 44 | $disabledOptions = $options; 45 | } 46 | if (!$this->{$check}($options['model']) && (!empty($disabledTitle) || !empty($disabledOptions))) { 47 | if (!empty($disabledTitle) && $disabledTitle !== true) { 48 | $title = $disabledTitle; 49 | } 50 | $options = array_merge($_defaults, (array)$disabledOptions); 51 | } elseif (!$this->{$check}($options['model'])) { 52 | return null; 53 | } 54 | foreach (array_keys($_defaults) as $key) { 55 | ${$key} = $options[$key]; 56 | unset($options[$key]); 57 | } 58 | $url = array_merge(array('page' => $paging['page'] + ($which == 'Prev' ? $step * -1 : $step)), $url); 59 | $title = ($which == 'Prev') ? '‹' : '›'; 60 | unset($options['rel']); 61 | return $this->Html->tag($tag, $this->link($title, $url, array_merge($options, compact('escape'))), compact('class')); 62 | } 63 | 64 | /** 65 | * First 66 | * 67 | * @param $first string 68 | * @param $options array 69 | * @return string 70 | */ 71 | public function first($first = '«', $options = array()) 72 | { 73 | $defaults = array( 74 | 'tag' => 'li', 75 | 'after' => null, 76 | 'model' => $this->defaultModel(), 77 | 'separator' => null, 78 | 'ellipsis' => '...', 79 | 'class' => null, 80 | 'escape' => false 81 | ); 82 | $options += $defaults; 83 | $params = array_merge(array('page' => 1), (array)$this->params($options['model'])); 84 | unset($options['model']); 85 | if ($params['pageCount'] <= 1) { 86 | return false; 87 | } 88 | extract($options); 89 | unset($options['tag'], $options['after'], $options['model'], $options['separator'], $options['ellipsis'], $options['class']); 90 | $out = ''; 91 | if (is_int($first) && $params['page'] >= $first) { 92 | if ($after === null) { 93 | $after = $ellipsis; 94 | } 95 | for ($i = 1; $i <= $first; $i++) { 96 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class')); 97 | if ($i != $first) { 98 | $out .= $separator; 99 | } 100 | } 101 | $out .= $after; 102 | } elseif ($params['page'] > 1 && is_string($first)) { 103 | $out = $this->Html->tag($tag, $this->link($first, array('page' => 1), $options), compact('class')) . $after; 104 | } 105 | return $out; 106 | } 107 | 108 | /** 109 | * Last 110 | * 111 | * @param $last string 112 | * @param $options array 113 | * @return string 114 | */ 115 | public function last($last = '»', $options = array()) 116 | { 117 | $options = array_merge( 118 | array( 119 | 'tag' => 'li', 120 | 'before' => null, 121 | 'model' => $this->defaultModel(), 122 | 'separator' => ' | ', 123 | 'ellipsis' => '...', 124 | 'class' => null, 125 | 'escape' => false 126 | ), 127 | (array)$options); 128 | $params = array_merge(array('page' => 1), (array)$this->params($options['model'])); 129 | unset($options['model']); 130 | if ($params['pageCount'] <= 1) { 131 | return false; 132 | } 133 | extract($options); 134 | unset($options['tag'], $options['before'], $options['model'], $options['separator'], $options['ellipsis'], $options['class']); 135 | $out = ''; 136 | $lower = $params['pageCount'] - $last + 1; 137 | if (is_int($last) && $params['page'] <= $lower) { 138 | if ($before === null) { 139 | $before = $ellipsis; 140 | } 141 | for ($i = $lower; $i <= $params['pageCount']; $i++) { 142 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class')); 143 | if ($i != $params['pageCount']) { 144 | $out .= $separator; 145 | } 146 | } 147 | $out = $before . $out; 148 | } elseif ($params['page'] < $params['pageCount'] && is_string($last)) { 149 | $options += array('rel' => 'last'); 150 | $out = $before . $this->Html->tag( 151 | $tag, $this->link($last, array('page' => $params['pageCount']), $options), compact('class') 152 | ); 153 | } 154 | return $out; 155 | } 156 | 157 | /** 158 | * Numbers 159 | * 160 | * @param $options array 161 | * @return string 162 | */ 163 | public function numbers($options = array()) 164 | { 165 | $defaults = array( 166 | 'tag' => 'li', 167 | 'before' => null, 168 | 'after' => null, 169 | 'model' => $this->defaultModel(), 170 | 'class' => null, 171 | 'modulus' => '8', 172 | 'separator' => null, 173 | 'first' => null, 174 | 'last' => null, 175 | 'ellipsis' => '...', 176 | ); 177 | $options += $defaults; 178 | $params = (array) $this->params($options['model']) + array('page' => 1); 179 | unset($options['model']); 180 | if ($params['pageCount'] <= 1) { 181 | return false; 182 | } 183 | extract($options); 184 | unset($options['tag'], $options['before'], $options['after'], $options['model'], 185 | $options['modulus'], $options['separator'], $options['first'], $options['last'], 186 | $options['ellipsis'], $options['class'] 187 | ); 188 | $out = ''; 189 | if ($modulus && $params['pageCount'] > $modulus) { 190 | $half = intval($modulus / 2); 191 | $end = $params['page'] + $half; 192 | if ($end > $params['pageCount']) { 193 | $end = $params['pageCount']; 194 | } 195 | $start = $params['page'] - ($modulus - ($end - $params['page'])); 196 | if ($start <= 1) { 197 | $start = 1; 198 | $end = $params['page'] + ($modulus - $params['page']) + 1; 199 | } 200 | if ($first && $start > 1) { 201 | $offset = ($start <= (int)$first) ? $start - 1 : $first; 202 | if ($offset < $start - 1) { 203 | $out .= $this->first($offset, compact('tag', 'separator', 'ellipsis', 'class')); 204 | } else { 205 | $out .= $this->first($offset, compact('tag', 'separator', 'class') + array('after' => $separator)); 206 | } 207 | } 208 | $out .= $before; 209 | for ($i = $start; $i < $params['page']; $i++) { 210 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class')) 211 | . $separator; 212 | } 213 | $currentClass = 'active'; 214 | if ($class) { 215 | $currentClass .= ' ' . $class; 216 | } 217 | //$out .= $this->Html->tag($tag, $params['page'], array('class' => $currentClass)); 218 | $out .= $this->Html->tag($tag, $this->link($params['page']), array('class' => $currentClass)); 219 | if ($i != $params['pageCount']) { 220 | $out .= $separator; 221 | } 222 | $start = $params['page'] + 1; 223 | for ($i = $start; $i < $end; $i++) { 224 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class')) . $separator; 225 | } 226 | if ($end != $params['page']) { 227 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $end), $options), compact('class')); 228 | } 229 | $out .= $after; 230 | if ($last && $end < $params['pageCount']) { 231 | $offset = ($params['pageCount'] < $end + (int)$last) ? $params['pageCount'] - $end : $last; 232 | if ($offset <= $last && $params['pageCount'] - $end > $offset) { 233 | $out .= $this->last($offset, compact('tag', 'separator', 'ellipsis', 'class')); 234 | } else { 235 | $out .= $this->last($offset, compact('tag', 'separator', 'class') + array('before' => $separator)); 236 | } 237 | } 238 | } else { 239 | $out .= $before; 240 | for ($i = 1; $i <= $params['pageCount']; $i++) { 241 | $cls = empty($class) ? null : $class; 242 | if ($i == $params['page']) { 243 | $cls .= ' active'; 244 | } 245 | $out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), array('class' => $cls)); 246 | if ($i != $params['pageCount']) { 247 | $out .= $separator; 248 | } 249 | } 250 | $out .= $after; 251 | } 252 | return $out; 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /Controller/AdminAppController.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | 16 | App::uses('AppController', 'Controller'); 17 | App::uses('Folder', 'Utility'); 18 | 19 | class AdminAppController extends AppController 20 | { 21 | /** 22 | * Helpers 23 | * 24 | * @var array 25 | */ 26 | public $helpers = array( 27 | 'BSForm' => array( 28 | 'className' => 'Admin.BootstrapForm' 29 | ), 30 | 'Html', 31 | 'Session' => array( 32 | 'className' => 'Admin.BootstrapSession' 33 | ), 34 | 'Paginator' => array( 35 | 'className' => 'Admin.BootstrapPaginator' 36 | ) 37 | ); 38 | 39 | // Check if they are logged in 40 | 41 | 42 | function authenticate() 43 | { 44 | // Check if the session variable User exists, redirect to loginform if not 45 | if(!$this->Session->check('User')) 46 | { 47 | $this->redirect(array('controller' => 'users', 'action' => 'login_form')); 48 | exit(); 49 | } 50 | } 51 | 52 | // Authenticate on every action, except the login form 53 | function afterFilter() 54 | { 55 | if( $this->action != 'login_form' ) 56 | { 57 | $this->authenticate(); 58 | } 59 | } 60 | 61 | /** 62 | * Scaffold 63 | * 64 | * @var string 65 | */ 66 | public $scaffold; 67 | 68 | /** 69 | * Pagination 70 | * 71 | * @var string 72 | */ 73 | 74 | public function beforeRender() 75 | { 76 | 77 | 78 | } 79 | 80 | /** 81 | * Before Filter 82 | * 83 | * @return void 84 | */ 85 | public function beforeFilter() 86 | { 87 | $modelClass = $this->modelClass; 88 | // $fieldKey = $this->field(); 89 | $Model = ClassRegistry::init($modelClass); 90 | 91 | $ignoreModelList = array(); 92 | if(isset($Model->ignoreModelList)){ 93 | $ignoreModelList = $Model->ignoreModelList; 94 | } 95 | $displayFieldTypes[$modelClass] = array(); 96 | if(isset($Model->displayFieldTypes)){ 97 | $displayFieldTypes[$modelClass] = $Model->displayFieldTypes; 98 | } 99 | // Get association model displayfield types 100 | foreach ($Model->hasMany as $key => $value) { 101 | $subModel = ClassRegistry::init($value['className']); 102 | $displayFieldTypes[$key] = $subModel->displayFieldTypes; 103 | } 104 | $ignoreFieldList = array(); 105 | if(isset($Model->ignoreFieldList)){ 106 | $ignoreFieldList = $Model->ignoreFieldList; 107 | } 108 | $adminSettings = array(); 109 | if(isset($Model->adminSettings)){ 110 | $adminSettings = $Model->adminSettings; 111 | } 112 | 113 | parent::beforeFilter(); 114 | $iconPath = APP.'Plugin'.DS.'Admin'.DS.'webroot'.DS.'img'.DS.'admin_icons'; 115 | $iconFolder = new Folder($iconPath); 116 | $iconsInFolder = $iconFolder->find('.*png', true); 117 | foreach ($iconsInFolder as $key => $value) { 118 | $iconsInFolder[$key] = str_replace('.png', '', $value); 119 | } 120 | $Folder = new Folder(APP . 'Model'); 121 | $files = $Folder->find('.*\.php', true); 122 | $navbar = array(); 123 | foreach ($files as $file) { 124 | if ($file !== 'AppModel.php') { 125 | $model = str_replace('.php', '', $file); 126 | $Model = ClassRegistry::init($model); 127 | $schema = $Model->schema(); 128 | if(!in_array($model, $ignoreModelList) && isset($schema)){ 129 | if(isset($Model->adminSettings['icon'])){ 130 | $icon_file = $iconPath.DS.$Model->adminSettings['icon'].'.png'; 131 | if(file_exists($icon_file)){ 132 | $icon = $Model->adminSettings['icon']; 133 | } else { 134 | $icon = $iconsInFolder[0]; 135 | array_shift($iconsInFolder); 136 | } 137 | } else { 138 | $icon = $iconsInFolder[0]; 139 | array_shift($iconsInFolder); 140 | } 141 | $controller = Inflector::tableize($model); 142 | $title = Inflector::pluralize($model); 143 | $navbar[] = array( 144 | 'title' => $title, 145 | 'url' => array( 146 | 'plugin' => 'admin', 147 | 'controller' => $controller, 148 | 'action' => 'index', 149 | ), 150 | 'icon' => $icon, 151 | ); 152 | } 153 | } 154 | } 155 | $data = $this->request->data; 156 | if($data){ 157 | $Model = ClassRegistry::init($modelClass); 158 | $imgDir = $Model->upLoads['imgDir']; 159 | foreach ($data[$modelClass] as $key => $value) { 160 | if(isset($displayFieldTypes[$modelClass][$key]) && $displayFieldTypes[$modelClass][$key] == 'image'){ 161 | if(empty($value['name'])){ 162 | unset($this->request->data[$modelClass][$key]); 163 | } else { 164 | $itemDir = ''; 165 | if(isset($Model->upLoads['itemDir']) && !empty($Model->upLoads['itemDir'])){ 166 | // set as a field value or as a string in model $upLoads variable 167 | $itemDir = $Model->upLoads['itemDir']; 168 | if(is_array($itemDir) && isset($itemDir['field'])) { 169 | $itemField = $itemDir['field']; 170 | if(isset($data[$modelClass][$itemField])){ 171 | $itemDir = $data[$modelClass][$itemField]; 172 | } 173 | } else { 174 | $itemDir = $Model->upLoads['itemDir']; 175 | } 176 | } 177 | $fileOK = $this->uploadFiles($imgDir, $value, $itemDir); 178 | 179 | if(array_key_exists('urls', $fileOK)) { 180 | // save the url in the form data 181 | $this->request->data[$modelClass][$key] = $fileOK['urls'][0]; 182 | } 183 | } 184 | } 185 | } 186 | } 187 | if(empty($ignoreFieldList)) 188 | $ignoreFieldList = array(); 189 | if(empty($displayFieldTypes)) 190 | $displayFieldTypes = array(); 191 | if(empty($ignoreModelList)) 192 | $ignoreModelList = array(); 193 | if(empty($adminSettings)) 194 | $adminSettings = array(); 195 | $this->set(compact('navbar','displayFieldTypes','ignoreFieldList', 'adminSettings')); 196 | } 197 | 198 | /** 199 | * uploads files 200 | * @return: 201 | * will return an array with the success of each file upload 202 | */ 203 | public function uploadFiles($folder=null, $formdata, $itemId = null) { 204 | // setup dir names absolute and relative 205 | if(isset($folder)){ 206 | $folder_url = WWW_ROOT.'img'.DS.$folder; 207 | $rel_url = 'img'.DS.$folder; 208 | } else { 209 | $folder_url = WWW_ROOT.'img'; 210 | $rel_url = 'img'; 211 | } 212 | 213 | // create the folder if it does not exist 214 | if(!is_dir($folder_url)) { 215 | mkdir($folder_url); 216 | } 217 | // if itemId is set create an item/sub folder 218 | if($itemId) { 219 | // set new absolute folder 220 | $folder_url = $folder_url.DS.$itemId; 221 | // set new relative folder 222 | $rel_url = $rel_url.DS.$itemId; 223 | // create the folder if it does not exist 224 | if(!is_dir($folder_url)) { 225 | mkdir($folder_url); 226 | } 227 | } 228 | 229 | // list of permitted file types 230 | $permitted = array('image/gif','image/jpeg','image/pjpeg','image/png'); 231 | 232 | // replace spaces with underscores 233 | $filename = $formdata['name']; 234 | $filename = str_replace(' ', '_', $filename); 235 | // assume filetype is false 236 | $typeOK = false; 237 | // check filetype is ok 238 | foreach($permitted as $type) { 239 | if($type == $formdata['type']) { 240 | $typeOK = true; 241 | break; 242 | } 243 | } 244 | 245 | // if file type ok upload the file 246 | if($typeOK) { 247 | // switch based on error code 248 | switch($formdata['error']) { 249 | case 0: 250 | // check filename already exists 251 | if(!file_exists($folder_url.DS.$filename)) { 252 | // create full filename 253 | $full_url = $folder_url.DS.$filename; 254 | $url = $rel_url.DS.$filename; 255 | // upload the file 256 | $success = move_uploaded_file($formdata['tmp_name'], $url); 257 | 258 | } else { 259 | // create unique filename and upload file 260 | // ini_set('date.timezone', 'India/Maldives'); 261 | $now = date('Y-m-d-His'); 262 | $full_url = $folder_url.DS.$now.$filename; 263 | $url = $rel_url.DS.$now.$filename; 264 | $success = move_uploaded_file($formdata['tmp_name'], $url); 265 | } 266 | // if upload was successful 267 | if($success) { 268 | // save the url of the file 269 | $result['urls'][] = substr($url, 4); 270 | } else { 271 | $result['errors'][] = "Error uploaded $filename. Please try again."; 272 | } 273 | break; 274 | case 3: 275 | // an error occured 276 | $result['errors'][] = "Error uploading $filename. Please try again."; 277 | break; 278 | default: 279 | // an error occured 280 | $result['errors'][] = "System error uploading $filename. Contact webmaster."; 281 | break; 282 | } 283 | } elseif($formdata['error'] == 4) { 284 | // no file was selected for upload 285 | $result['nofiles'][] = "No file Selected"; 286 | } else { 287 | // unacceptable file type 288 | $result['errors'][] = "$filename cannot be uploaded. Acceptable file types: gif, jpg, png."; 289 | } 290 | 291 | return $result; 292 | } 293 | } 294 | -------------------------------------------------------------------------------- /View/Scaffolds/view.ctp: -------------------------------------------------------------------------------- 1 | 11 | * @copyright Copyright 2012, Maldicore Group Pvt Ltd. (http://maldicore.com) 12 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) 13 | * @since CakePHP(tm) v 2.1.1 14 | */ 15 | ?> 16 |
17 |
18 |
19 | 20 | 36 |
37 |
38 |
39 |
40 |
41 | Session->flash(); ?> 42 | 45 |
46 | 47 | 48 | 49 | $_details): ?> 50 | 51 | 52 |
53 | 54 | Html->link(${$singularVar}[$_alias][$_details['displayField']], array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])); ?> 55 |
56 |
57 | 58 | 59 | 60 | 61 | 62 | 63 |
64 | 65 | Html->image($f_value); 71 | } else { 72 | echo $f_value." (image not found)"; 73 | } 74 | } 75 | if($displayFieldTypes[$modelClass][$_field] == 'checkbox'){ 76 | if($f_value){ 77 | echo $this->html->image('/Admin/img/check_yellow.png'); 78 | } else { 79 | echo $this->html->image('/Admin/img/cross_red.png'); 80 | } 81 | } 82 | if($displayFieldTypes[$modelClass][$_field] == 'wysihtml'){ 83 | echo $f_value; 84 | } 85 | } else { 86 | echo $f_value; 87 | } 88 | ?> 89 |
90 |
91 | 92 | 93 | 94 |
95 | 96 | $_details): ?> 97 |
98 |

99 | 100 |
101 | 102 | 103 |
104 | 105 | 106 |
107 |
108 | 109 |
110 | 111 |
112 | Html->link(__d('cake', 'Edit %s', Inflector::humanize(Inflector::underscore($_alias))), array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'edit', ${$singularVar}[$_alias][$_details['primaryKey']]), array('class' => 'btn primary')); ?> 113 |
114 |
115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | $_details): ?> 125 | 126 |
127 |

128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 |
148 | Html->image($f_value,array('width'=>150)); 154 | } else { 155 | echo $f_value." (image not found)"; 156 | } 157 | } 158 | if($displayFieldTypes[$_alias][$_field] == 'checkbox'){ 159 | if($f_value){ 160 | echo $this->html->image('/Admin/img/check_yellow.png'); 161 | } else { 162 | echo $this->html->image('/Admin/img/cross_red.png'); 163 | } 164 | } 165 | if($displayFieldTypes[$_alias][$_field] == 'wysihtml'){ 166 | echo $f_value; 167 | } 168 | } else { 169 | echo $f_value; 170 | } 171 | ?> 172 | Html->link(__d('cake', 'View'), array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'view', ${$otherSingularVar}[$_details['primaryKey']]), array('class' => 'btn btn-info')); ?>Html->link(__d('cake', 'Edit'), array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'edit', ${$otherSingularVar}[$_details['primaryKey']]), array('class' => 'btn btn-warning')); ?>Html->link(__d('cake', 'Delete'), array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'delete', ${$otherSingularVar}[$_details['primaryKey']]), array('class' => 'btn btn-danger'), __d('cake', 'Are you sure you want to delete %s %s?', Inflector::humanize(Inflector::underscore($_alias)), ${$otherSingularVar}[$_details['primaryKey']])); ?>
181 | 182 |
183 | Html->link(__d('cake', "New %s", Inflector::humanize(Inflector::underscore($_alias))), array('plugin' => 'admin', 'controller' => $_details['controller'], 'action' => 'add'), array('class' => 'btn btn-primary')); ?> 184 |
185 |
186 | 187 |
188 |
-------------------------------------------------------------------------------- /webroot/js/bootstrap-datepicker.js: -------------------------------------------------------------------------------- 1 | /* ========================================================= 2 | * bootstrap-datepicker.js 3 | * http://www.eyecon.ro/bootstrap-datepicker 4 | * ========================================================= 5 | * Copyright 2012 Stefan Petre 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================= */ 19 | 20 | !function( $ ) { 21 | 22 | // Picker object 23 | 24 | var Datepicker = function(element, options){ 25 | this.element = $(element); 26 | this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy'); 27 | this.picker = $(DPGlobal.template) 28 | .appendTo('body') 29 | .on({ 30 | click: $.proxy(this.click, this), 31 | mousedown: $.proxy(this.mousedown, this) 32 | }); 33 | this.isInput = this.element.is('input'); 34 | this.component = this.element.is('.date') ? this.element.find('.add-on') : false; 35 | 36 | if (this.isInput) { 37 | this.element.on({ 38 | focus: $.proxy(this.show, this), 39 | blur: $.proxy(this.hide, this), 40 | keyup: $.proxy(this.update, this) 41 | }); 42 | } else { 43 | if (this.component){ 44 | this.component.on('click', $.proxy(this.show, this)); 45 | } else { 46 | this.element.on('click', $.proxy(this.show, this)); 47 | } 48 | } 49 | this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0; 50 | if (typeof this.minViewMode === 'string') { 51 | switch (this.minViewMode) { 52 | case 'months': 53 | this.minViewMode = 1; 54 | break; 55 | case 'years': 56 | this.minViewMode = 2; 57 | break; 58 | default: 59 | this.minViewMode = 0; 60 | break; 61 | } 62 | } 63 | this.viewMode = options.viewMode||this.element.data('date-viewmode')||0; 64 | if (typeof this.viewMode === 'string') { 65 | switch (this.viewMode) { 66 | case 'months': 67 | this.viewMode = 1; 68 | break; 69 | case 'years': 70 | this.viewMode = 2; 71 | break; 72 | default: 73 | this.viewMode = 0; 74 | break; 75 | } 76 | } 77 | this.startViewMode = this.viewMode; 78 | this.weekStart = options.weekStart||this.element.data('date-weekstart')||0; 79 | this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1; 80 | this.fillDow(); 81 | this.fillMonths(); 82 | this.update(); 83 | this.showMode(); 84 | }; 85 | 86 | Datepicker.prototype = { 87 | constructor: Datepicker, 88 | 89 | show: function(e) { 90 | this.picker.show(); 91 | this.height = this.component ? this.component.outerHeight() : this.element.outerHeight(); 92 | this.place(); 93 | $(window).on('resize', $.proxy(this.place, this)); 94 | if (e ) { 95 | e.stopPropagation(); 96 | e.preventDefault(); 97 | } 98 | if (!this.isInput) { 99 | $(document).on('mousedown', $.proxy(this.hide, this)); 100 | } 101 | this.element.trigger({ 102 | type: 'show', 103 | date: this.date 104 | }); 105 | }, 106 | 107 | hide: function(){ 108 | this.picker.hide(); 109 | $(window).off('resize', this.place); 110 | this.viewMode = this.startViewMode; 111 | this.showMode(); 112 | if (!this.isInput) { 113 | $(document).off('mousedown', this.hide); 114 | } 115 | this.set(); 116 | this.element.trigger({ 117 | type: 'hide', 118 | date: this.date 119 | }); 120 | }, 121 | 122 | set: function() { 123 | var formated = DPGlobal.formatDate(this.date, this.format); 124 | if (!this.isInput) { 125 | if (this.component){ 126 | this.element.find('input').prop('value', formated); 127 | } 128 | this.element.data('date', formated); 129 | } else { 130 | this.element.prop('value', formated); 131 | } 132 | }, 133 | 134 | setValue: function(newDate) { 135 | if (typeof newDate === 'string') { 136 | this.date = DPGlobal.parseDate(newDate, this.format); 137 | } else { 138 | this.date = new Date(newDate); 139 | } 140 | this.set(); 141 | this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0); 142 | this.fill(); 143 | }, 144 | 145 | place: function(){ 146 | var offset = this.component ? this.component.offset() : this.element.offset(); 147 | this.picker.css({ 148 | top: offset.top + this.height, 149 | left: offset.left 150 | }); 151 | }, 152 | 153 | update: function(newDate){ 154 | this.date = DPGlobal.parseDate( 155 | typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')), 156 | this.format 157 | ); 158 | this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0); 159 | this.fill(); 160 | }, 161 | 162 | fillDow: function(){ 163 | var dowCnt = this.weekStart; 164 | var html = ''; 165 | while (dowCnt < this.weekStart + 7) { 166 | html += ''+DPGlobal.dates.daysMin[(dowCnt++)%7]+''; 167 | } 168 | html += ''; 169 | this.picker.find('.datepicker-days thead').append(html); 170 | }, 171 | 172 | fillMonths: function(){ 173 | var html = ''; 174 | var i = 0 175 | while (i < 12) { 176 | html += ''+DPGlobal.dates.monthsShort[i++]+''; 177 | } 178 | this.picker.find('.datepicker-months td').append(html); 179 | }, 180 | 181 | fill: function() { 182 | var d = new Date(this.viewDate), 183 | year = d.getFullYear(), 184 | month = d.getMonth(), 185 | currentDate = this.date.valueOf(); 186 | this.picker.find('.datepicker-days th:eq(1)') 187 | .text(DPGlobal.dates.months[month]+' '+year); 188 | var prevMonth = new Date(year, month-1, 28,0,0,0,0), 189 | day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth()); 190 | prevMonth.setDate(day); 191 | prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7); 192 | var nextMonth = new Date(prevMonth); 193 | nextMonth.setDate(nextMonth.getDate() + 42); 194 | nextMonth = nextMonth.valueOf(); 195 | html = []; 196 | var clsName; 197 | while(prevMonth.valueOf() < nextMonth) { 198 | if (prevMonth.getDay() === this.weekStart) { 199 | html.push(''); 200 | } 201 | clsName = ''; 202 | if (prevMonth.getMonth() < month) { 203 | clsName += ' old'; 204 | } else if (prevMonth.getMonth() > month) { 205 | clsName += ' new'; 206 | } 207 | if (prevMonth.valueOf() === currentDate) { 208 | clsName += ' active'; 209 | } 210 | html.push(''+prevMonth.getDate() + ''); 211 | if (prevMonth.getDay() === this.weekEnd) { 212 | html.push(''); 213 | } 214 | prevMonth.setDate(prevMonth.getDate()+1); 215 | } 216 | this.picker.find('.datepicker-days tbody').empty().append(html.join('')); 217 | var currentYear = this.date.getFullYear(); 218 | 219 | var months = this.picker.find('.datepicker-months') 220 | .find('th:eq(1)') 221 | .text(year) 222 | .end() 223 | .find('span').removeClass('active'); 224 | if (currentYear === year) { 225 | months.eq(this.date.getMonth()).addClass('active'); 226 | } 227 | 228 | html = ''; 229 | year = parseInt(year/10, 10) * 10; 230 | var yearCont = this.picker.find('.datepicker-years') 231 | .find('th:eq(1)') 232 | .text(year + '-' + (year + 9)) 233 | .end() 234 | .find('td'); 235 | year -= 1; 236 | for (var i = -1; i < 11; i++) { 237 | html += ''+year+''; 238 | year += 1; 239 | } 240 | yearCont.html(html); 241 | }, 242 | 243 | click: function(e) { 244 | e.stopPropagation(); 245 | e.preventDefault(); 246 | var target = $(e.target).closest('span, td, th'); 247 | if (target.length === 1) { 248 | switch(target[0].nodeName.toLowerCase()) { 249 | case 'th': 250 | switch(target[0].className) { 251 | case 'switch': 252 | this.showMode(1); 253 | break; 254 | case 'prev': 255 | case 'next': 256 | this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call( 257 | this.viewDate, 258 | this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) + 259 | DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1) 260 | ); 261 | this.fill(); 262 | this.set(); 263 | break; 264 | } 265 | break; 266 | case 'span': 267 | if (target.is('.month')) { 268 | var month = target.parent().find('span').index(target); 269 | this.viewDate.setMonth(month); 270 | } else { 271 | var year = parseInt(target.text(), 10)||0; 272 | this.viewDate.setFullYear(year); 273 | } 274 | if (this.viewMode !== 0) { 275 | this.date = new Date(this.viewDate); 276 | this.element.trigger({ 277 | type: 'changeDate', 278 | date: this.date, 279 | viewMode: DPGlobal.modes[this.viewMode].clsName 280 | }); 281 | } 282 | this.showMode(-1); 283 | this.fill(); 284 | this.set(); 285 | break; 286 | case 'td': 287 | if (target.is('.day')){ 288 | var day = parseInt(target.text(), 10)||1; 289 | var month = this.viewDate.getMonth(); 290 | if (target.is('.old')) { 291 | month -= 1; 292 | } else if (target.is('.new')) { 293 | month += 1; 294 | } 295 | var year = this.viewDate.getFullYear(); 296 | this.date = new Date(year, month, day,0,0,0,0); 297 | this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0); 298 | this.fill(); 299 | this.set(); 300 | this.element.trigger({ 301 | type: 'changeDate', 302 | date: this.date, 303 | viewMode: DPGlobal.modes[this.viewMode].clsName 304 | }); 305 | } 306 | break; 307 | } 308 | } 309 | }, 310 | 311 | mousedown: function(e){ 312 | e.stopPropagation(); 313 | e.preventDefault(); 314 | }, 315 | 316 | showMode: function(dir) { 317 | if (dir) { 318 | this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir)); 319 | } 320 | this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show(); 321 | } 322 | }; 323 | 324 | $.fn.datepicker = function ( option, val ) { 325 | return this.each(function () { 326 | var $this = $(this), 327 | data = $this.data('datepicker'), 328 | options = typeof option === 'object' && option; 329 | if (!data) { 330 | $this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options)))); 331 | } 332 | if (typeof option === 'string') data[option](val); 333 | }); 334 | }; 335 | 336 | $.fn.datepicker.defaults = { 337 | }; 338 | $.fn.datepicker.Constructor = Datepicker; 339 | 340 | var DPGlobal = { 341 | modes: [ 342 | { 343 | clsName: 'days', 344 | navFnc: 'Month', 345 | navStep: 1 346 | }, 347 | { 348 | clsName: 'months', 349 | navFnc: 'FullYear', 350 | navStep: 1 351 | }, 352 | { 353 | clsName: 'years', 354 | navFnc: 'FullYear', 355 | navStep: 10 356 | }], 357 | dates:{ 358 | days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], 359 | daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], 360 | daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"], 361 | months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], 362 | monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] 363 | }, 364 | isLeapYear: function (year) { 365 | return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)) 366 | }, 367 | getDaysInMonth: function (year, month) { 368 | return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month] 369 | }, 370 | parseFormat: function(format){ 371 | var separator = format.match(/[.\/\-\s].*?/), 372 | parts = format.split(/\W+/); 373 | if (!separator || !parts || parts.length === 0){ 374 | throw new Error("Invalid date format."); 375 | } 376 | return {separator: separator, parts: parts}; 377 | }, 378 | parseDate: function(date, format) { 379 | var parts = date.split(format.separator), 380 | date = new Date(), 381 | val; 382 | date.setHours(0); 383 | date.setMinutes(0); 384 | date.setSeconds(0); 385 | date.setMilliseconds(0); 386 | if (parts.length === format.parts.length) { 387 | for (var i=0, cnt = format.parts.length; i < cnt; i++) { 388 | val = parseInt(parts[i], 10)||1; 389 | switch(format.parts[i]) { 390 | case 'dd': 391 | case 'd': 392 | date.setDate(val); 393 | break; 394 | case 'mm': 395 | case 'm': 396 | date.setMonth(val - 1); 397 | break; 398 | case 'yy': 399 | date.setFullYear(2000 + val); 400 | break; 401 | case 'yyyy': 402 | date.setFullYear(val); 403 | break; 404 | } 405 | } 406 | } 407 | return date; 408 | }, 409 | formatDate: function(date, format){ 410 | var val = { 411 | d: date.getDate(), 412 | m: date.getMonth() + 1, 413 | yy: date.getFullYear().toString().substring(2), 414 | yyyy: date.getFullYear() 415 | }; 416 | val.dd = (val.d < 10 ? '0' : '') + val.d; 417 | val.mm = (val.m < 10 ? '0' : '') + val.m; 418 | var date = []; 419 | for (var i=0, cnt = format.parts.length; i < cnt; i++) { 420 | date.push(val[format.parts[i]]); 421 | } 422 | return date.join(format.separator); 423 | }, 424 | headTemplate: ''+ 425 | ''+ 426 | '‹'+ 427 | ''+ 428 | '›'+ 429 | ''+ 430 | '', 431 | contTemplate: '' 432 | }; 433 | DPGlobal.template = ''; 453 | 454 | }( window.jQuery ) -------------------------------------------------------------------------------- /webroot/js/advanced.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Full HTML5 compatibility rule set 3 | * These rules define which tags and css classes are supported and which tags should be specially treated. 4 | * 5 | * Examples based on this rule set: 6 | * 7 | * foo 8 | * ... becomes ... 9 | * foo 10 | * 11 | * 12 | * ... becomes ... 13 | * 14 | * 15 | *
foo
16 | * ... becomes ... 17 | *
foo
18 | * 19 | * foo 20 | * ... becomes ... 21 | * foo 22 | * 23 | * foo
bar 24 | * ... becomes ... 25 | * foo
bar 26 | * 27 | *
hello
28 | * ... becomes ... 29 | *
hello
30 | * 31 | *
hello
32 | * ... becomes ... 33 | *
hello
34 | */ 35 | var wysihtml5ParserRules = { 36 | /** 37 | * CSS Class white-list 38 | * Following css classes won't be removed when parsed by the wysihtml5 html parser 39 | */ 40 | "classes": { 41 | "wysiwyg-clear-both": 1, 42 | "wysiwyg-clear-left": 1, 43 | "wysiwyg-clear-right": 1, 44 | "wysiwyg-color-aqua": 1, 45 | "wysiwyg-color-black": 1, 46 | "wysiwyg-color-blue": 1, 47 | "wysiwyg-color-fuchsia": 1, 48 | "wysiwyg-color-gray": 1, 49 | "wysiwyg-color-green": 1, 50 | "wysiwyg-color-lime": 1, 51 | "wysiwyg-color-maroon": 1, 52 | "wysiwyg-color-navy": 1, 53 | "wysiwyg-color-olive": 1, 54 | "wysiwyg-color-purple": 1, 55 | "wysiwyg-color-red": 1, 56 | "wysiwyg-color-silver": 1, 57 | "wysiwyg-color-teal": 1, 58 | "wysiwyg-color-white": 1, 59 | "wysiwyg-color-yellow": 1, 60 | "wysiwyg-float-left": 1, 61 | "wysiwyg-float-right": 1, 62 | "wysiwyg-font-size-large": 1, 63 | "wysiwyg-font-size-larger": 1, 64 | "wysiwyg-font-size-medium": 1, 65 | "wysiwyg-font-size-small": 1, 66 | "wysiwyg-font-size-smaller": 1, 67 | "wysiwyg-font-size-x-large": 1, 68 | "wysiwyg-font-size-x-small": 1, 69 | "wysiwyg-font-size-xx-large": 1, 70 | "wysiwyg-font-size-xx-small": 1, 71 | "wysiwyg-text-align-center": 1, 72 | "wysiwyg-text-align-justify": 1, 73 | "wysiwyg-text-align-left": 1, 74 | "wysiwyg-text-align-right": 1 75 | }, 76 | /** 77 | * Tag list 78 | * 79 | * Following options are available: 80 | * 81 | * - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class 82 | * The following methods are implemented in wysihtml5.dom.parse: 83 | * - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*") 84 |

foo

... becomes ...

class="wysiwyg-text-align-center">foo

85 | * - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*" 86 | *
... becomes ...
87 | * - align_img: converts align attribute values (right/left) on to their corresponding css class "wysiwyg-float-*" 88 | * 89 | * - remove: removes the element and it's content 90 | * 91 | * - rename_tag: renames the element to the given tag 92 | * 93 | * - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above) 94 | * 95 | * - set_attributes: sets/overrides the given attributes 96 | * 97 | * - check_attributes: checks the given HTML attribute via the given method 98 | * - url: checks whether the given string is an url, deletes the attribute if not 99 | * - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML) 100 | * - numbers: ensures that the attribute only contains numeric characters 101 | */ 102 | "tags": { 103 | "tr": { 104 | "add_class": { 105 | "align": "align_text" 106 | } 107 | }, 108 | "strike": { 109 | "remove": 1 110 | }, 111 | "form": { 112 | "rename_tag": "div" 113 | }, 114 | "rt": { 115 | "rename_tag": "span" 116 | }, 117 | "code": {}, 118 | "acronym": { 119 | "rename_tag": "span" 120 | }, 121 | "br": { 122 | "add_class": { 123 | "clear": "clear_br" 124 | } 125 | }, 126 | "details": { 127 | "rename_tag": "div" 128 | }, 129 | "h4": { 130 | "add_class": { 131 | "align": "align_text" 132 | } 133 | }, 134 | "em": {}, 135 | "title": { 136 | "remove": 1 137 | }, 138 | "multicol": { 139 | "rename_tag": "div" 140 | }, 141 | "figure": { 142 | "rename_tag": "div" 143 | }, 144 | "xmp": { 145 | "rename_tag": "span" 146 | }, 147 | "small": { 148 | "rename_tag": "span", 149 | "set_class": "wysiwyg-font-size-smaller" 150 | }, 151 | "area": { 152 | "remove": 1 153 | }, 154 | "time": { 155 | "rename_tag": "span" 156 | }, 157 | "dir": { 158 | "rename_tag": "ul" 159 | }, 160 | "bdi": { 161 | "rename_tag": "span" 162 | }, 163 | "command": { 164 | "remove": 1 165 | }, 166 | "ul": {}, 167 | "progress": { 168 | "rename_tag": "span" 169 | }, 170 | "dfn": { 171 | "rename_tag": "span" 172 | }, 173 | "iframe": { 174 | "remove": 1 175 | }, 176 | "figcaption": { 177 | "rename_tag": "div" 178 | }, 179 | "a": { 180 | "check_attributes": { 181 | "href": "url" 182 | }, 183 | "set_attributes": { 184 | "rel": "nofollow", 185 | "target": "_blank" 186 | } 187 | }, 188 | "img": { 189 | "check_attributes": { 190 | "width": "numbers", 191 | "alt": "alt", 192 | "src": "url", 193 | "height": "numbers" 194 | }, 195 | "add_class": { 196 | "align": "align_img" 197 | } 198 | }, 199 | "rb": { 200 | "rename_tag": "span" 201 | }, 202 | "footer": { 203 | "rename_tag": "div" 204 | }, 205 | "noframes": { 206 | "remove": 1 207 | }, 208 | "abbr": { 209 | "rename_tag": "span" 210 | }, 211 | "u": {}, 212 | "bgsound": { 213 | "remove": 1 214 | }, 215 | "sup": { 216 | "rename_tag": "span" 217 | }, 218 | "address": { 219 | "rename_tag": "div" 220 | }, 221 | "basefont": { 222 | "remove": 1 223 | }, 224 | "nav": { 225 | "rename_tag": "div" 226 | }, 227 | "h1": { 228 | "add_class": { 229 | "align": "align_text" 230 | } 231 | }, 232 | "head": { 233 | "remove": 1 234 | }, 235 | "tbody": { 236 | "add_class": { 237 | "align": "align_text" 238 | } 239 | }, 240 | "dd": { 241 | "rename_tag": "div" 242 | }, 243 | "s": { 244 | "rename_tag": "span" 245 | }, 246 | "li": {}, 247 | "td": { 248 | "check_attributes": { 249 | "rowspan": "numbers", 250 | "colspan": "numbers" 251 | }, 252 | "add_class": { 253 | "align": "align_text" 254 | } 255 | }, 256 | "object": { 257 | "remove": 1 258 | }, 259 | "div": { 260 | "add_class": { 261 | "align": "align_text" 262 | } 263 | }, 264 | "option": { 265 | "rename_tag": "span" 266 | }, 267 | "select": { 268 | "rename_tag": "span" 269 | }, 270 | "i": {}, 271 | "track": { 272 | "remove": 1 273 | }, 274 | "wbr": { 275 | "remove": 1 276 | }, 277 | "fieldset": { 278 | "rename_tag": "div" 279 | }, 280 | "big": { 281 | "rename_tag": "span", 282 | "set_class": "wysiwyg-font-size-larger" 283 | }, 284 | "button": { 285 | "rename_tag": "span" 286 | }, 287 | "noscript": { 288 | "remove": 1 289 | }, 290 | "svg": { 291 | "remove": 1 292 | }, 293 | "input": { 294 | "remove": 1 295 | }, 296 | "table": {}, 297 | "keygen": { 298 | "remove": 1 299 | }, 300 | "h5": { 301 | "add_class": { 302 | "align": "align_text" 303 | } 304 | }, 305 | "meta": { 306 | "remove": 1 307 | }, 308 | "map": { 309 | "rename_tag": "div" 310 | }, 311 | "isindex": { 312 | "remove": 1 313 | }, 314 | "mark": { 315 | "rename_tag": "span" 316 | }, 317 | "caption": { 318 | "add_class": { 319 | "align": "align_text" 320 | } 321 | }, 322 | "tfoot": { 323 | "add_class": { 324 | "align": "align_text" 325 | } 326 | }, 327 | "base": { 328 | "remove": 1 329 | }, 330 | "video": { 331 | "remove": 1 332 | }, 333 | "strong": {}, 334 | "canvas": { 335 | "remove": 1 336 | }, 337 | "output": { 338 | "rename_tag": "span" 339 | }, 340 | "marquee": { 341 | "rename_tag": "span" 342 | }, 343 | "b": {}, 344 | "q": { 345 | "check_attributes": { 346 | "cite": "url" 347 | } 348 | }, 349 | "applet": { 350 | "remove": 1 351 | }, 352 | "span": {}, 353 | "rp": { 354 | "rename_tag": "span" 355 | }, 356 | "spacer": { 357 | "remove": 1 358 | }, 359 | "source": { 360 | "remove": 1 361 | }, 362 | "aside": { 363 | "rename_tag": "div" 364 | }, 365 | "frame": { 366 | "remove": 1 367 | }, 368 | "section": { 369 | "rename_tag": "div" 370 | }, 371 | "body": { 372 | "rename_tag": "div" 373 | }, 374 | "ol": {}, 375 | "nobr": { 376 | "rename_tag": "span" 377 | }, 378 | "html": { 379 | "rename_tag": "div" 380 | }, 381 | "summary": { 382 | "rename_tag": "span" 383 | }, 384 | "var": { 385 | "rename_tag": "span" 386 | }, 387 | "del": { 388 | "remove": 1 389 | }, 390 | "blockquote": { 391 | "check_attributes": { 392 | "cite": "url" 393 | } 394 | }, 395 | "style": { 396 | "remove": 1 397 | }, 398 | "device": { 399 | "remove": 1 400 | }, 401 | "meter": { 402 | "rename_tag": "span" 403 | }, 404 | "h3": { 405 | "add_class": { 406 | "align": "align_text" 407 | } 408 | }, 409 | "textarea": { 410 | "rename_tag": "span" 411 | }, 412 | "embed": { 413 | "remove": 1 414 | }, 415 | "hgroup": { 416 | "rename_tag": "div" 417 | }, 418 | "font": { 419 | "rename_tag": "span", 420 | "add_class": { 421 | "size": "size_font" 422 | } 423 | }, 424 | "tt": { 425 | "rename_tag": "span" 426 | }, 427 | "noembed": { 428 | "remove": 1 429 | }, 430 | "thead": { 431 | "add_class": { 432 | "align": "align_text" 433 | } 434 | }, 435 | "blink": { 436 | "rename_tag": "span" 437 | }, 438 | "plaintext": { 439 | "rename_tag": "span" 440 | }, 441 | "xml": { 442 | "remove": 1 443 | }, 444 | "h6": { 445 | "add_class": { 446 | "align": "align_text" 447 | } 448 | }, 449 | "param": { 450 | "remove": 1 451 | }, 452 | "th": { 453 | "check_attributes": { 454 | "rowspan": "numbers", 455 | "colspan": "numbers" 456 | }, 457 | "add_class": { 458 | "align": "align_text" 459 | } 460 | }, 461 | "legend": { 462 | "rename_tag": "span" 463 | }, 464 | "hr": {}, 465 | "label": { 466 | "rename_tag": "span" 467 | }, 468 | "dl": { 469 | "rename_tag": "div" 470 | }, 471 | "kbd": { 472 | "rename_tag": "span" 473 | }, 474 | "listing": { 475 | "rename_tag": "div" 476 | }, 477 | "dt": { 478 | "rename_tag": "span" 479 | }, 480 | "nextid": { 481 | "remove": 1 482 | }, 483 | "pre": {}, 484 | "center": { 485 | "rename_tag": "div", 486 | "set_class": "wysiwyg-text-align-center" 487 | }, 488 | "audio": { 489 | "remove": 1 490 | }, 491 | "datalist": { 492 | "rename_tag": "span" 493 | }, 494 | "samp": { 495 | "rename_tag": "span" 496 | }, 497 | "col": { 498 | "remove": 1 499 | }, 500 | "article": { 501 | "rename_tag": "div" 502 | }, 503 | "cite": {}, 504 | "link": { 505 | "remove": 1 506 | }, 507 | "script": { 508 | "remove": 1 509 | }, 510 | "bdo": { 511 | "rename_tag": "span" 512 | }, 513 | "menu": { 514 | "rename_tag": "ul" 515 | }, 516 | "colgroup": { 517 | "remove": 1 518 | }, 519 | "ruby": { 520 | "rename_tag": "span" 521 | }, 522 | "h2": { 523 | "add_class": { 524 | "align": "align_text" 525 | } 526 | }, 527 | "ins": { 528 | "rename_tag": "span" 529 | }, 530 | "p": { 531 | "add_class": { 532 | "align": "align_text" 533 | } 534 | }, 535 | "sub": { 536 | "rename_tag": "span" 537 | }, 538 | "comment": { 539 | "remove": 1 540 | }, 541 | "frameset": { 542 | "remove": 1 543 | }, 544 | "optgroup": { 545 | "rename_tag": "span" 546 | }, 547 | "header": { 548 | "rename_tag": "div" 549 | } 550 | } 551 | }; -------------------------------------------------------------------------------- /webroot/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger("close").removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h]();if(e.hasClass("active"))return;return!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3,pause:"hover"},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();return this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element[a?"addClass":"removeClass"]("collapse"),this},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('