Overview

Namespaces

  • Cron
  • None

Classes

  • _HtmlGrid_TableOut
  • _TransactionModel_RawSaveOperation
  • AccessControlComponent
  • AccessControlHelper
  • ActionListHelper
  • ActiveDirectoryUtils
  • AddCurrentPidToSchedulingShellCallLogs
  • AnonymousFunctionOperation
  • ArrayUtil
  • AssociationIntegrityBehavior
  • AtomicOperation
  • AuthenticationComponent
  • AuthenticationController
  • AuthenticationUser
  • AutocompleteDatasourceComponent
  • BaseModelComponent
  • Basics
  • CakeLayersHelper
  • CheckAndRunShell
  • ClassSearcher
  • CommandLineUtil
  • CommonValidationBehavior
  • ConfigurableShellCallsSchedulingTask
  • ConfigurationKey
  • ConfigurationKeys
  • ConfigurationKeysController
  • Context
  • ContextComponent
  • ContextHelper
  • Contexts
  • ControllerInspector
  • ControllerMenuHelper
  • CreateJournalingTables
  • CreateTableConfigurationKeys
  • CreateTableSchedulingConfigurableShellCalls
  • CreateTableSchedulingShellCallLogs
  • CreateTableSettedConfigurationKeys
  • CreateTableUserResetPasswordRequests
  • CreateTableUsers
  • CronSchedulingInstaller
  • CronValidationBehavior
  • CssBox
  • CssController
  • CssProperties
  • CssShell
  • CsvUtil
  • CustomDataModel
  • DatasourceDumperManager
  • DateTimeInput
  • DependencyShell
  • DetailHelper
  • DumperShell
  • ExtendedFieldsAccessControl
  • ExtendedFieldSet
  • ExtendedFieldSetHelper
  • ExtendedFieldsParser
  • ExtendedFormHelper
  • ExtendedHasManyAppModel
  • ExtendedOperationsBehavior
  • FieldDefinition
  • FieldRowDefinition
  • FieldSetDefinition
  • FieldSetLayoutHelper
  • FileOperations
  • FileOperations_Rename
  • FileOperations_SymLink
  • FileOperations_Touch
  • FileOperations_Unlink
  • FileSystem
  • FixConfigurationKeysPrimaryKey
  • FixSettedConfigurationKeysPrimaryKey
  • HasManyUtilsBehavior
  • HtmlDocument
  • HtmlGrid
  • HtmlGrid_Cell
  • HttpClient
  • HttpResponse
  • ImapClient
  • ImapMailBox
  • ImapParserShell
  • IncludePath
  • InputMasked
  • InputSearchable
  • InputsOnSubmit
  • InstallShell
  • JenkinsBuildShell
  • Journal
  • JournalDetail
  • JournalizedBehavior
  • JsonResponseComponent
  • LayoutsHelper
  • Ldap
  • LdapUtils
  • ListFieldSet
  • ListFieldSetHelper
  • ListsHelper
  • MailParser
  • Make
  • MenuHelper
  • MigrationAllPluginsShell
  • ModelOperations
  • ModelOperations_Delete
  • ModelOperations_Save
  • ModelTraverser
  • MysqlDumper
  • OpenLdapUtils
  • PaginatorUtilComponent
  • PaginatorUtilComponentFilter
  • PaginatorUtilHelper
  • Plugin
  • PluginManager
  • Reflections
  • RenameEnabledToActiveFromUsersTable
  • RunShellCallShell
  • ScaffoldUtilComponent
  • ScaffoldUtilHelper
  • Scheduling
  • SchedulingConfigurableShellCall
  • SchedulingConfigurableShellCallsController
  • SchedulingShellCallLog
  • SchedulingShellCallLogsController
  • SettedConfigurationKey
  • StuffreposPluginsRename
  • TimeZoneBehavior
  • TransactionModel
  • TransactionOperation
  • Translator
  • TranslatorShell
  • User
  • UserAuthenticationComponent
  • UserChangePassword
  • UserResetPassword
  • UserResetPasswordRequest
  • UserResetPasswordRequestSubmission
  • UsersController
  • ViewUtilHelper

Interfaces

  • AccessControlFilter
  • CommitableOperation
  • DatasourceDumper
  • MakeListener
  • SchedulingInstaller
  • TasksObject
  • UndoableOperation

Exceptions

  • LdapObjectNotWritableException
  • ModelTraverserException
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: App::uses('CssBox', 'Layouts.Lib');
 4: 
 5: class CssController extends AppController {
 6: 
 7:     public function beforeFilter() {
 8:         parent::beforeFilter();
 9: 
10:         if (isset($this->Auth)) {
11:             $this->Auth->allow('process');
12:         }
13:     }
14: 
15:     public function process($path) {
16:         if (file_exists($this->_cssFilePath($path))) {
17:             $this->_serveCss(file_get_contents($this->_cssFilePath($path)));
18:         } else {
19:             throw new Exception("File not found: {$this->_cssFilePath($path)}");
20:         }
21:     }
22: 
23:     public function css_box($selectors) {        
24:         $box = new CssBox($this->request->params['named']);
25:         $this->_serveCss($box->build($selectors));
26:     }
27: 
28:     private function _serveCss($content) {
29:         $this->response->type('text/css');
30:         //$this->response->header('Expires: '.gmdate('D, d M Y H:i:s',time() + (60 * 60 * 24 * $days_to_cache)).' GMT');
31: 
32:         foreach ($this->_variables() as $name => $value) {
33:             $content = preg_replace('/\$' . preg_quote($name) . '(?!\w)/', $value, $content);
34:         }
35: 
36:         $this->response->body($content);
37:         $this->autoRender = false;
38:         $this->autoLayout = false;
39:         return $this->response;
40:     }
41: 
42:     private function _variables() {
43:         if (file_exists($this->_variablesFilePath())) {
44:             $vars = parse_ini_file($this->_variablesFilePath());
45:         } else {
46:             $vars = array();
47:         }
48: 
49:         $vars['WEBROOT'] = Router::url('/', true);
50: 
51:         return $vars;
52:     }
53: 
54:     private function _variablesFilePath() {
55:         return $this->_cssDirectoryPath() . DS . 'variables.ini';
56:     }
57: 
58:     private function _cssDirectoryPath() {
59:         return ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS . 'css';
60:     }
61: 
62:     private function _cssFilePath($path) {
63:         return ROOT . DS . APP_DIR . DS . WEBROOT_DIR . DS . 'css' . DS . $path . '.css';
64:     }
65: 
66: }
67: 
68: ?>
69: 
API documentation generated by ApiGen 2.8.0