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('CssProperties', 'Layouts.Lib');
 4: App::uses('ArrayUtil', 'Base.Lib');
 5: 
 6: class CssBox {
 7: 
 8:     private $borderRadius = '3px';
 9:     private $borderWidth = '1px';
10:     private $borderStyle = 'solid';
11:     private $borderColor = '#7d99ca';
12:     private $backgroundColorStart = '#d3d3d3';
13:     private $backgroundColorEnd = '#707070';
14:     private $padding = '10px';
15:     private $autoBuildHover = false;
16: 
17:     public function __construct($options) {
18:         foreach ($options as $name => $value) {
19:             if (isset($this->{$name})) {
20:                 $this->{$name} = $value;
21:             }
22:         }
23:     }
24: 
25:     public function build($selectors) {
26:         $b = $this->_defaultProperties()->build($selectors);
27:         if ($this->autoBuildHover) {
28:             $b .= $this->_hoverProperties()->build($selectors, 'hover');
29:         }
30:         return $b;
31:     }
32: 
33:     /**
34:      * 
35:      * @param boolean $invertBackgroundColorStartEnd
36:      * @return CssProperties
37:      */
38:     private function _defaultProperties() {
39:         $props = new CssProperties(array(
40:             '-webkit-border-radius' => $this->borderRadius,
41:             '-moz-border-radius' => $this->borderRadius,
42:             'border-radius' => $this->borderRadius,
43:             'border-width' => $this->borderWidth,
44:             'border-style' => $this->borderStyle,
45:             'border-color' => $this->borderColor,            
46:             'padding' => $this->padding,
47:             'text-decoration' => 'none',
48:             'display' => 'inline-block',            
49:             'filter' => "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr={$this->backgroundColorStart}, endColorstr={$this->backgroundColorEnd})",
50:         ));
51:         return $props->add($this->_gradientProperties(false));
52:     }
53:     
54:     /**
55:      * @return CssProperties
56:      */
57:     private function _hoverProperties() {
58:         return $this->_gradientProperties(true);
59:     }
60:     
61:     /**
62:      * @return CssProperties
63:      */
64:     private function _gradientProperties($invertBackgroundColorStartEnd) {
65:         if ($invertBackgroundColorStartEnd) {
66:             $backgroundColorEnd = $this->backgroundColorStart;
67:             $backgroundColorStart = $this->backgroundColorEnd;
68:         } else {
69:             $backgroundColorStart = $this->backgroundColorStart;
70:             $backgroundColorEnd = $this->backgroundColorEnd;
71:         }
72: 
73:         return new CssProperties(array(
74:             'background-color' => $backgroundColorStart,
75:             'background-image' => array(
76:                 "-webkit-gradient(linear, left top, left bottom, from({$backgroundColorStart}), to({$backgroundColorEnd}))",
77:                 "-webkit-linear-gradient(top, {$backgroundColorStart}, {$backgroundColorEnd})",
78:                 "-moz-linear-gradient(top, {$backgroundColorStart}, {$backgroundColorEnd})",
79:                 "-ms-linear-gradient(top, {$backgroundColorStart}, {$backgroundColorEnd})",
80:                 "-o-linear-gradient(top, {$backgroundColorStart}, {$backgroundColorEnd})",
81:                 "linear-gradient(to bottom, {$backgroundColorStart}, {$backgroundColorEnd})",
82:             ),
83:             'filter' => "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr={$this->backgroundColorStart}, endColorstr={$this->backgroundColorEnd})",
84:         ));
85:     }
86: 
87: }
88: 
API documentation generated by ApiGen 2.8.0