Changeset 89 in ExiteCMS8
- Timestamp:
- 09/07/11 16:10:31 (9 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 35 edited
- 4 moved
-
exitecms/classes/controller/bootstrap.php (modified) (3 diffs)
-
exitecms/classes/exitecms.php (modified) (1 diff)
-
exitecms/classes/exitecms/exception.php (moved) (moved from trunk/exitecms/classes/exitecmsexception.php) (1 diff)
-
exitecms/classes/exitecms/forms.php (modified) (5 diffs)
-
exitecms/classes/exitecms/module.php (modified) (2 diffs)
-
exitecms/classes/exitecms/modules.php (moved) (moved from trunk/exitecms/classes/module.php) (2 diffs)
-
exitecms/classes/exitecms/themes.php (moved) (moved from trunk/exitecms/classes/theme.php) (2 diffs)
-
exitecms/config/config.php (modified) (1 diff)
-
exitecms/config/session.php (modified) (1 diff)
-
exitecms/config/version.php (modified) (1 diff)
-
exitecms/views/exception.php (modified) (2 diffs)
-
modules/exitecms/classes/controller/datetime.php (modified) (1 diff)
-
modules/exitecms/classes/controller/install.php (modified) (1 diff)
-
modules/exitecms/classes/controller/locales.php (modified) (1 diff)
-
modules/exitecms/classes/controller/modules.php (modified) (6 diffs)
-
modules/exitecms/classes/controller/security.php (modified) (1 diff)
-
modules/exitecms/classes/controller/templates.php (modified) (7 diffs)
-
modules/exitecms/classes/controller/themes.php (modified) (4 diffs)
-
modules/exitecms/classes/model/module.php (modified) (1 diff)
-
modules/exitecms/classes/model/moduleplugin.php (modified) (1 diff)
-
modules/exitecms/classes/model/modulewidget.php (moved) (moved from trunk/modules/exitecms/classes/model/moduleitem.php) (2 diffs)
-
modules/exitecms/classes/model/page.php (modified) (2 diffs)
-
modules/exitecms/classes/model/pagesection.php (modified) (1 diff)
-
modules/exitecms/classes/model/site.php (modified) (1 diff)
-
modules/exitecms/classes/model/template.php (modified) (1 diff)
-
modules/exitecms/classes/model/templatesection.php (modified) (1 diff)
-
modules/exitecms/lang/en/templates.php (modified) (4 diffs)
-
modules/exitecms/views/forms/datetime.php (modified) (1 diff)
-
modules/exitecms/views/forms/layout.php (modified) (3 diffs)
-
modules/exitecms/views/forms/layout_selector.php (modified) (1 diff)
-
modules/exitecms/views/forms/linkset.php (modified) (1 diff)
-
modules/exitecms/views/forms/sections.php (added)
-
modules/linksets/classes/controller/module.php (modified) (1 diff)
-
modules/linksets/classes/controller/multi.php (modified) (2 diffs)
-
modules/linksets/classes/controller/single.php (modified) (3 diffs)
-
modules/linksets/config/info.php (modified) (1 diff)
-
modules/phpinfo/classes/view/phpinfo.php (modified) (1 diff)
-
themes/theme_exitecms/assets/css/default.css (modified) (4 diffs)
-
themes/theme_exitecms/assets/js/jquery-1.6.2.min.js (added)
-
themes/theme_exitecms/assets/js/jquery-ui-1.8.16.custom.min.js (added)
-
themes/theme_exitecms/config/default.php (modified) (2 diffs)
-
themes/theme_exitecms/views/templates/default.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/exitecms/classes/controller/bootstrap.php
r84 r89 90 90 { 91 91 // load the defined theme controller 92 static::$theme = \ Theme::forge($layout['theme']);92 static::$theme = \ExiteCMS_Themes::forge($layout['theme']); 93 93 94 94 // load the defined theme template … … 210 210 // store the current URI in the session 211 211 $session->set('last_uri', \Input::uri()); 212 213 return $this->response; 212 214 } 213 215 … … 299 301 if ( ! isset($config['404']) ) 300 302 { 301 throw new Exitecms Exception('Unable to locate the requested page, and no 404 page has been defined');303 throw new Exitecms_Exception('Unable to locate the requested page, and no 404 page has been defined'); 302 304 } 303 305 $layout = $config['404']; -
trunk/exitecms/classes/exitecms.php
r79 r89 113 113 // ----------------------------------------------------------------- 114 114 115 public static function htmlentities($value)116 {117 static $already_cleaned = array();118 119 // Nothing to escape for non-string scalars, or for already processed values120 if (is_bool($value) or is_int($value) or is_float($value) or in_array($value, $already_cleaned, true))121 {122 return $value;123 }124 125 if (is_string($value))126 {127 $value = htmlentities($value, ENT_NOQUOTES, \Fuel::$encoding, false);128 }129 elseif (is_array($value) || $value instanceof \Iterator)130 {131 foreach ($value as $k => $v)132 {133 $value[$k] = static::htmlentities($v);134 }135 136 // Add to $already_cleaned variable when object137 is_object($value) and $already_cleaned[] = $value;138 }139 elseif (is_object($value))140 {141 // Check if the object is whitelisted and return when that's the case142 foreach (\Config::get('security.whitelisted_classes') as $class)143 {144 if (is_a($value, $class))145 {146 // Add to $already_cleaned variable147 $already_cleaned[] = $value;148 149 return $value;150 }151 }152 153 // Throw exception when it wasn't whitelisted and can't be converted to String154 if ( ! method_exists($value, '__toString'))155 {156 throw new \RuntimeException('Object class "'.get_class($value).'" could not be converted to string or '.157 'sanitized as ArrayAcces. Whitelist it in security.whitelisted_classes in app/config/config.php '.158 'to allow it to be passed unchecked.');159 }160 161 $value = static::htmlentities((string) $value);162 }163 164 return $value;165 }166 167 // -----------------------------------------------------------------168 169 115 /* 170 116 * TODO : has to move to a date or time class -
trunk/exitecms/classes/exitecms/exception.php
r79 r89 1 1 <?php 2 class Exitecms Exception extends Exception {2 class Exitecms_Exception extends Exception { 3 3 4 4 /** -
trunk/exitecms/classes/exitecms/forms.php
r79 r89 129 129 try 130 130 { 131 // create the view object for this forms method 132 empty($this->view) and $this->view = 'forms'.DS.$this->action; 133 134 if ( ! $this->view instanceOf View and ! $this->view instanceOf ViewModel) 135 { 136 $this->set_view(\View::forge($this->view)); 131 // check if a view is disabled for this request 132 if ($this->view === false) 133 { 134 // request has no output 135 $this->view = ''; 137 136 } 138 137 else 139 138 { 140 $this->set_view($this->view); 139 // create the view object for this forms method 140 empty($this->view) and $this->view = 'forms'.DS.$this->action; 141 142 if ( ! $this->view instanceOf View and ! $this->view instanceOf ViewModel) 143 { 144 $this->set_view(\View::forge($this->view)); 145 } 146 else 147 { 148 $this->set_view($this->view); 149 } 141 150 } 142 151 } 143 152 catch (Fuel_Exception $e) 144 153 { 145 $this->view = 'unable to locate the view';154 throw new \Exitecms_Exception('unable to locate the view: "'.$this->view.'".'); 146 155 } 147 156 … … 155 164 empty($this->response->body) and $this->response->body = $this->view; 156 165 } 166 167 return $this->response; 157 168 } 158 169 … … 550 561 { 551 562 // check for missing labels 552 ! isset($definition['label']) and $this->fields[$name]['label'] = \Lang::get('field.'.$name );563 ! isset($definition['label']) and $this->fields[$name]['label'] = \Lang::get('field.'.$name, array(), '<span style="background-color:yellow;color:black;padding:4px 8px;">label?</span>'); 553 564 554 565 // check for missing help text 555 ! isset($definition['help']) and $this->fields[$name]['help'] = \Lang::get('help.'.$name );566 ! isset($definition['help']) and $this->fields[$name]['help'] = \Lang::get('help.'.$name, array(), null); 556 567 557 568 // check for missing options array … … 575 586 * @return array 576 587 */ 577 protected function get_record($new = false )588 protected function get_record($new = false, $recnbr = null) 578 589 { 579 590 $record = $this->fields; … … 581 592 if ( ! $new) 582 593 { 583 $recnbr = $this->param(1);594 is_null($recnbr) and $recnbr = $this->param(1); 584 595 if ( ! empty($recnbr) and is_numeric($recnbr) and $recnbr >= 1) 585 596 { -
trunk/exitecms/classes/exitecms/module.php
r84 r89 133 133 foreach ($moduleinfo['widgets'] as $name => $widget) 134 134 { 135 $tplobj = new \ExiteCMS\Model_Module Item();135 $tplobj = new \ExiteCMS\Model_ModuleWidget(); 136 136 $tplobj->name = $name; 137 137 $tplobj->description = $widget['description']; 138 138 $tplobj->uri = $widget['uri']; 139 139 $tplobj->type = 'WIDGET'; 140 $model->moduleitem[] = $tplobj; 140 $tplobj->method = isset($widget['method']) ? $widget['method'] : null; 141 $model->modulewidget[] = $tplobj; 141 142 } 142 143 } … … 162 163 } 163 164 165 // ----------------------------------------------------------------- 166 167 /* 168 * run the options controller for a module widget 169 * 170 */ 171 public function options($method) 172 { 173 // check if the method exists 174 if ( ! method_exists($this, $method)) 175 { 176 throw new \Exitecms_Exception('Specified options method "'.$method.'" is not defined in '.get_class($this)); 177 } 178 179 180 } 181 164 182 } 165 183 -
trunk/exitecms/classes/exitecms/modules.php
r84 r89 13 13 */ 14 14 15 class Module{15 class ExiteCMS_Modules { 16 16 17 17 /** … … 104 104 * @return array array of module controller objects 105 105 */ 106 public static function modules()106 public static function get() 107 107 { 108 108 // module object storage -
trunk/exitecms/classes/exitecms/themes.php
r84 r89 13 13 */ 14 14 15 class Theme{15 class ExiteCMS_Themes { 16 16 17 17 /** … … 138 138 * @return array array of theme controller objects 139 139 */ 140 public static function themes()140 public static function get() 141 141 { 142 142 // theme object storage -
trunk/exitecms/config/config.php
r79 r89 127 127 * dependant on how much input data there is. 128 128 */ 129 'output_filter' => array(' Exitecms::htmlentities'),129 'output_filter' => array('Security::htmlentities'), 130 130 131 131 /** -
trunk/exitecms/config/session.php
r60 r89 36 36 // cookie path (optional, default = '/') 37 37 'cookie_path' => '/', 38 39 // cookie http_only flag (optional, default = use the cookie class default) 40 'cookie_http_only' => true, 38 41 39 42 // if true, the session expires when the browser is closed (optional, default = false) -
trunk/exitecms/config/version.php
r84 r89 14 14 15 15 /* 16 * revision number added by SubVersion on checkout/export * *16 * revision number added by SubVersion on checkout/export * 17 17 */ 18 18 $revision = explode(' ', "\$Rev$"); -
trunk/exitecms/views/exception.php
r68 r89 4 4 */ 5 5 $message = explode('|', $exception->getMessage()); 6 7 if (empty($message[1])) 8 { 9 $message[1] = 'Exception generated on line '.$exception->getLine().' of '.str_replace(APPPATH, 'APPPATH/', $exception->getFile()); 10 if ($code = $exception->getCode()) 11 { 12 $message[1] .= '<br />The exception code is '. $code; 13 } 14 } 15 6 16 if (empty($message[0])) 7 17 { 8 $message[0] = 'Exception generated on line '.$exception->getLine().' of '.str_replace(APPPATH, 'APPPATH/', $exception->getFile());9 if ($code = $exception->getCode())10 {11 $message[0] .= '<br />The exception code is '. $code;12 }13 }14 if (empty($message[1]))15 {16 $message[1] = $message[0];17 18 $message[0] = 'ExiteCMS does not know how to handle this situation.'; 18 19 } … … 37 38 38 39 <div id="content"> 39 < p><?php echo $message[0]; ?></p>40 <h2><?php echo $message[0]; ?></h2> 40 41 41 <pre><code><?php echo $message[1]; ?></code></pre> 42 <?php 43 if (ini_get('display_errors')) 44 { 45 echo '<pre><code>', $message[1], '</code></pre>'; 46 } 47 ?> 42 48 43 49 <p></p> -
trunk/modules/exitecms/classes/controller/datetime.php
r79 r89 220 220 * @return array 221 221 */ 222 protected function get_record( )222 protected function get_record($new = false, $recnbr = null) 223 223 { 224 224 // initial values -
trunk/modules/exitecms/classes/controller/install.php
r79 r89 252 252 * @return array 253 253 */ 254 protected function get_record( )254 protected function get_record($new = false, $recnbr = null) 255 255 { 256 256 // initial values -
trunk/modules/exitecms/classes/controller/locales.php
r79 r89 156 156 * @return array 157 157 */ 158 protected function get_record( )158 protected function get_record($new = false, $recnbr = null) 159 159 { 160 160 // initial values -
trunk/modules/exitecms/classes/controller/modules.php
r84 r89 40 40 parent::__construct($request, $response); 41 41 42 if ($this->action == 'remove') 42 if ($this->action == 'install') 43 { 44 // install doesn't use views, it redirects with a message 45 $this->view = false; 46 } 47 elseif ($this->action == 'remove') 43 48 { 44 49 $this->action = 'delete'; … … 116 121 { 117 122 // get the theme controller instance 118 $module = \ Module::forge($this->param(1));123 $module = \ExiteCMS_Modules::forge($this->param(1)); 119 124 120 125 // fetch the entire info array … … 275 280 { 276 281 // get the module controller instance 277 $module = \ Module::forge($this->param(1));282 $module = \ExiteCMS_Modules::forge($this->param(1)); 278 283 279 284 // start the installer … … 429 434 protected function before_delete() 430 435 { 431 // check if any of this module's items is used anywhere 432 foreach($this->model->moduleitem as $item) 433 { 436 // check if any of this module's widgets is used anywhere 437 foreach($this->model->modulewidget as $item) 438 { 439 // * TODO * 440 } 441 442 // check if any of this module's plugins is used anywhere 443 foreach($this->model->moduleplugin as $item) 444 { 445 // * TODO * 434 446 } 435 447 … … 446 458 { 447 459 // get the module controller instance 448 $module = \ Module::forge($this->param(1));460 $module = \ExiteCMS_Modules::forge($this->param(1)); 449 461 450 462 // start the remover … … 470 482 { 471 483 // get the available modules 472 $modules = \ Module::modules();484 $modules = \ExiteCMS_Modules::get(); 473 485 474 486 $found = $results = array(); -
trunk/modules/exitecms/classes/controller/security.php
r79 r89 254 254 * @return array 255 255 */ 256 protected function get_record( )256 protected function get_record($new = false, $recnbr = null) 257 257 { 258 258 // initial values -
trunk/modules/exitecms/classes/controller/templates.php
r79 r89 94 94 ); 95 95 96 // field: theme_template_id 97 $this->fields['theme_template_id'] = array( 98 'validation' => array( 99 'rules' => 'required', 100 'flags' => 'numeric' 101 ), 102 'type' => 'select', 103 'options' => array( 104 'style' => 'width: 95%;', 105 ), 106 'value' => 0, 107 'values' => Model_ThemeTemplate::templates_dropdown(), 108 ); 109 96 110 // field: locale 97 111 $this->fields['locale'] = array( … … 137 151 // custom form buttons 138 152 // ----------------------------------------------------------------- 153 154 /* 155 */ 156 protected function button_add() 157 { 158 \ExiteCMS::redirect(\ExiteCMS::baseurl(array_merge(array($this->baseurl, 'add' => 0), $this->param()))); 159 } 139 160 140 161 /* … … 303 324 if ($recnbr = $this->param(2)) 304 325 { 305 $this->root = Model_Page::forge()->find() 306 ->where($this->model->tree_get_property('tree_field'), $recnbr) 307 ->where($this->model->tree_get_property('left_field'), 1) 308 ->get_one(); 309 } 310 if (empty($this->root )) 326 $this->root = Model_Site::forge()->find($recnbr); 327 } 328 if (empty($this->root)) 311 329 { 312 330 // if we didn't find the site root, redirect to sites … … 479 497 public function action_layout() 480 498 { 499 // get the layout record 500 $layout = false; 501 if ($recnbr = $this->param('layout')) 502 { 503 $layout = Model_Template::forge()->find($recnbr); 504 } 505 if (empty($layout)) 506 { 507 // if we didn't find the layout page, redirect to sites 508 is_null($layout) and \ExiteCMS_Messages::set(\Lang::get('message.notfound_template'), 'E'); 509 \ExiteCMS::redirect(\ExiteCMS::baseurl(array($this->baseurl, 'site' => $this->param('site')))); 510 } 511 481 512 // set the form title 482 513 $this->view->set('title', \Lang::get('action.layout.title'), false); … … 486 517 487 518 // define the form header 488 $this->view->set('header', array('title' => \Lang::get('action.layout.form'), 'options' => array('colspan' => 2))); 519 $this->view->set('header', 520 array( 521 'widgets' => \Lang::get('action.layout.form.1'), 522 'layout' => \Lang::get('action.layout.form.2', array('theme' => $layout->themetemplate->theme->name, 'template' => $layout->themetemplate->name)) 523 ) 524 ); 525 526 // fetch the already defined 527 $widgets = array(); 528 foreach($layout->templatesection as $widget) 529 { 530 if ( ! isset($widgets[$widget->section])) 531 { 532 $widgets[$widget->section] = array(); 533 } 534 $widgets[$widget->section][$widget->order] = $widget; 535 } 489 536 490 537 // define the theme page layout 491 $layout = \ Theme::instance('exitecms')->layout('default');538 $layout = \ExiteCMS_Themes::instance('exitecms')->layout($layout->themetemplate->name); 492 539 493 540 // define the baseurl for the selectors … … 497 544 $div = \View::forge('forms/layout_selector'); 498 545 $areas = array(); 499 foreach (\Theme::instance('exitecms')->get_areas() as $name => $area) 500 { 501 // cloning is faster than recreating the view object 502 $div = clone $div; 546 foreach (\ExiteCMS_Themes::instance('exitecms')->get_areas() as $name => $area) 547 { 503 548 $div->set('name', $name); 504 549 $div->set('description', $area['layout']['description']); 505 550 (! isset($area['layout']['height']) or $area['layout']['height'] < 65) and $area['layout']['height'] = 65; 506 551 $div->set('height', $area['layout']['height']); 507 $url = array_merge(array('widgets' => $name), $this->params); 508 array_unshift($url, $this->baseurl); 509 $url = \ExiteCMS::baseurl($url); 510 $div->set('url', $url); 511 $div->set('type', 'add-type-here'); 512 $div->set('count', 'add-counter-here'); 513 $areas[$name] = $div; 552 $div->set('count', isset($widgets[$name]) ? count($widgets[$name]) : 0); 553 $div->set('total', isset($area['max']) ? $area['max'] : 0); 554 $div->set('widgets', isset($widgets[$name]) ? $widgets[$name] : array()); 555 $areas[$name] = $div->render(); 514 556 } 515 557 … … 518 560 // add the layout to the view 519 561 $this->view->set('layout', $layout, false); 562 563 // add the widgets to the view 564 $this->view->set('widgets', Model_Module::find()->order_by(array('name' => 'asc'))->where('active','=', 1)->get()); 520 565 521 566 // buttons to be placed under the form -
trunk/modules/exitecms/classes/controller/themes.php
r84 r89 116 116 { 117 117 // get the theme controller instance 118 $theme = \ Theme::forge($this->param(1));118 $theme = \ExiteCMS_Themes::forge($this->param(1)); 119 119 120 120 // fetch the defined templates … … 273 273 { 274 274 // get the theme controller instance 275 $theme = \ Theme::forge($this->param(1));275 $theme = \ExiteCMS_Themes::forge($this->param(1)); 276 276 277 277 // start the installer … … 454 454 { 455 455 // get the theme controller instance 456 $theme = \ Theme::forge($this->param(1));456 $theme = \ExiteCMS_Themes::forge($this->param(1)); 457 457 458 458 // start the remover … … 478 478 { 479 479 // get the available themes 480 $themes = \ Theme::themes();480 $themes = \ExiteCMS_Themes::get(); 481 481 482 482 $found = $results = array(); -
trunk/modules/exitecms/classes/model/module.php
r84 r89 26 26 */ 27 27 protected static $_has_many = array( 28 'module item' => array(28 'modulewidget' => array( 29 29 'key_from' => 'id', 30 30 'key_to' => 'module_id', -
trunk/modules/exitecms/classes/model/moduleplugin.php
r84 r89 36 36 } 37 37 38 /* End of file module item.php */38 /* End of file moduleplugin.php */ -
trunk/modules/exitecms/classes/model/modulewidget.php
r58 r89 15 15 namespace Exitecms; 16 16 17 class Model_Module Itemextends \Orm\Model {17 class Model_ModuleWidget extends \Orm\Model { 18 18 19 19 /* 20 20 * @var string name of the table 21 21 */ 22 protected static $_table_name = 'module_ items';22 protected static $_table_name = 'module_widgets'; 23 23 24 24 /* … … 36 36 } 37 37 38 /* End of file module item.php */38 /* End of file modulewidget.php */ -
trunk/modules/exitecms/classes/model/page.php
r79 r89 38 38 */ 39 39 protected static $_has_one = array( 40 'theme _template' => array(40 'themetemplate' => array( 41 41 'model_to' => 'Exitecms\\Model_Themetemplate', 42 42 'key_from' => 'theme_template_id', … … 57 57 */ 58 58 protected static $_has_many = array( 59 'page _section' => array(59 'pagesection' => array( 60 60 'model_to' => 'Exitecms\\Model_Pagesection', 61 61 'key_from' => 'id', -
trunk/modules/exitecms/classes/model/pagesection.php
r58 r89 33 33 */ 34 34 protected static $_has_one = array( 35 'module item' => array(36 'key_from' => 'module_ item_id',35 'modulewidget' => array( 36 'key_from' => 'module_widget_id', 37 37 'key_to' => 'id', 38 38 'cascade_save' => true, -
trunk/modules/exitecms/classes/model/site.php
r79 r89 21 21 */ 22 22 protected static $_has_one = array( 23 'theme _template' => array(23 'themetemplate' => array( 24 24 'model_to' => 'Exitecms\\Model_Themetemplate', 25 25 'key_from' => 'theme_template_id', -
trunk/modules/exitecms/classes/model/template.php
r79 r89 23 23 'site' => array( 24 24 'key_from' => 'site_id', 25 'key_to' => 'id', 26 'cascade_save' => true, 27 'cascade_delete' => false, 28 ), 29 ); 30 31 /* 32 * @var array belongs_to relations of this model 33 */ 34 protected static $_has_one = array( 35 'themetemplate' => array( 36 'model_to' => 'Exitecms\\Model_Themetemplate', 37 'key_from' => 'theme_template_id', 25 38 'key_to' => 'id', 26 39 'cascade_save' => true, -
trunk/modules/exitecms/classes/model/templatesection.php
r58 r89 33 33 */ 34 34 protected static $_has_one = array( 35 'module item' => array(36 'key_from' => 'module_ item_id',35 'modulewidget' => array( 36 'key_from' => 'module_widget_id', 37 37 'key_to' => 'id', 38 38 'cascade_save' => true, -
trunk/modules/exitecms/lang/en/templates.php
r73 r89 11 11 'header' => 'Available templates', 12 12 'actions' => 'Options', 13 'theme_template_id' => 'Theme template used', 13 14 'name' => 'Name', 14 15 'title' => 'Template title', … … 41 42 'add' => array( 42 43 'title' => 'Templates', 43 'form' => 'Add a new page t o site ":site"',44 'form' => 'Add a new page template to site ":site"', 44 45 'info' => 'Use this form to add a new page template to your website.<br /> 45 46 Please enter the name of this template, a title so you can identify the template, … … 66 67 'layout' => array( 67 68 'title' => 'Templates', 68 'form' => 'Edit the page template definition', 69 'info' => 'Use this form to edit a page template.<br /> 70 Please enter the name of this template, a title so you can identify the template, 71 and optionally default page description and default meta keywords.', 69 'form' => array( 70 '1' => 'Available widgets', 71 '2' => 'Theme ":theme", template ":template"', 72 ), 73 'info' => 'Use this form to edit the sections of a page template.<br /> 74 Below you see the layout of the selected theme template, with the defined widget sections, 75 the name of each section, and the widget count.<br /> 76 At the left is the list of defined module widgets. Use drag-and-drop to add widgets 77 to, or remove them from the template. Refer to the theme template documentation to make 78 sure the widgets you select are of the correct type, and will fit in the space allocated 79 on the template.', 72 80 'success' => 'The website template layout has been updated.', 73 81 'failure' => 'Error updating the website template layout.', … … 107 115 'other' => array( 108 116 'layout' => array( 109 ' title' => 'Click to define the widgets for ":desc"',110 ' supported' => 'Supports elements of type:',111 ' count' => 'Number of elements assigned:',117 'module' => 'Module', 118 'widgets' => 'widgets', 119 'totalcount' => ':count of :total', 112 120 ), 113 121 ), -
trunk/modules/exitecms/views/forms/datetime.php
r79 r89 1 1 <?php 2 2 // load the edit view for the datetime form 3 echo \View::forge('forms/edit')->set($ view_data, null, false);3 echo \View::forge('forms/edit')->set($__data, null, false); 4 4 ?> 5 5 <table style="font-size:10px;"> -
trunk/modules/exitecms/views/forms/layout.php
r79 r89 4 4 */ 5 5 \Asset::js('jquery.tipTip.minified.js', array(), 'footer'); 6 \Asset::js('jquery-ui-1.8.16.custom.min.js', array(), 'header'); 6 7 7 // closure to generate a table header 8 $generate_header = function($header) { 9 echo "\t", '<tr>', html_tag('th', $header['options'], $header['title']), "\t", '</tr>', "\n"; 10 $header['options']['class'] = 'spacer'; 11 echo "\t", '<tr>', html_tag('td', $header['options'], ' '), "\t", '</tr>', "\n"; 12 }; 8 echo ' 9 <h3 class="title">',$title, '</h3> 13 10 14 // display the widget header 15 if ( ! empty($title)) 11 <fieldset> 12 <legend>', \Lang::get('global.information'), '</legend> 13 <div class="info">', $info, '</div> 14 </fieldset> 15 16 <table id="template_table"> 17 <tr> 18 <th>',$header['widgets'],'</th> 19 <th>',$header['layout'],'</th> 20 </tr> 21 <tr> 22 <td> 23 <div id="template_widgets">'; 24 if ($widgets) 16 25 { 17 echo '<h3 class="title">',$title, '</h3>', "\n"; 18 } 19 20 // display the widget info text 21 if ( ! empty($info)) 22 { 23 echo '<fieldset>', "\n"; 24 echo "\t", '<legend>', \Lang::get('global.information'), '</legend>', "\n"; 25 echo "\t", '<div class="info">', $info, '</div>', "\n"; 26 echo '</fieldset>', "\n"; 27 } 28 29 // generate the form table 30 echo '<table id="layouttable">',"\n"; 31 32 // add the table header 33 if ( ! empty($header)) 34 { 35 if (isset($header['title']) and isset($header['options'])) 26 foreach($widgets as $module) 36 27 { 37 $generate_header($header); 38 } 39 else 40 { 41 $in_form_headers = true; 42 foreach($header as $headerline) 28 if ($module->modulewidget) 43 29 { 44 if (empty($headerline['before']) and empty($headerline['after'])) 30 echo '<ul><li title="',$module->description,'">', \Lang::get('other.layout.module'), ': ', strtoupper($module->name),'<ul>'; 31 foreach($module->modulewidget as $widget) 45 32 { 46 $generate_header($headerline);33 echo '<li id="layout_widget_', $widget->id, '" class="layout_widget" title="',$widget->description,'">', $widget->name,'</li>'; 47 34 } 35 echo '</ul></li></ul>'; 48 36 } 49 37 } 50 38 } 51 echo '</table>',"\n";52 39 53 echo '<div id="template_layout">', "\n"; 54 echo $layout; 55 echo '</div>', "\n"; 40 41 echo ' </div> 42 </td> 43 <td> 44 <div id="template_layout"> 45 ',$layout,' 46 </div> 47 </td> 48 </tr> 49 </table>'; 56 50 57 51 // widget buttons … … 62 56 echo \Form::hidden('form_id', $form_id); 63 57 echo \Form::hidden(\Config::get('security.csrf_token_key', 'fuel_csrf_token'), \Security::fetch_token()); 58 echo \Form::hidden('section_div_name', ''); 59 echo \Form::hidden('section_sort_order', ''); 64 60 65 61 echo '<div style="text-align:center;margin:20px 0px;">',"\n"; … … 74 70 echo \Form::close(); 75 71 } 72 73 ?> 74 75 <!-- Layout definition scripts --> 76 <script type="text/javascript"> 77 $(function() { 78 $('#template_widgets').css('height', $('#template_layout').css('height')); 79 $('li[class="layout_widget"]').draggable({ 80 helper: 'clone', 81 revert: 'invalid' 82 }); 83 $('.layout_fieldset').droppable({ 84 accept: ':not(.ui-sortable-helper) :not(.layout_widget_selected)', 85 drop: function( event, ui ) { 86 $('<div></div>').html(ui.draggable.html()).attr('id', ui.draggable.attr('id')).addClass('layout_widget_selected').appendTo( $(this).find('div:first') ); 87 alert(ui.draggable.attr('id')); 88 alert($(this).find('div:first').attr('id')); 89 } 90 }).sortable({ 91 items: 'div', 92 placeholder: 'layout_widget_placeholder', 93 sort: function(e,ui){ 94 $(ui.placeholder).html(' ').css('width', '50px'); 95 $('#template_widgets').css('height', $('#template_layout').css('height')); 96 }, 97 update: function(e,ui){ 98 alert($(this).find('div:first').attr('id')); 99 var order = $('#test-list').sortable('serialize'); 100 } 101 }); 102 103 $('li[class="layout_widget_selected"]').draggable({ 104 revert: 'invalid' 105 }); 106 107 $('#template_widgets').droppable({ 108 accept: ':not(.ui-sortable-helper) :not(.layout_widget)', 109 drop: function( event, ui ) { 110 ui.draggable.remove(); 111 } 112 }); 113 }); 114 </script> -
trunk/modules/exitecms/views/forms/layout_selector.php
r79 r89 1 <?php 2 $numbers = empty($total) ? $count : \Lang::get('other.layout.totalcount', array('count' => $count, 'total' => $total)); 3 ?> 1 4 <div class="layout_background" style="height:100%;"> 2 <fieldset class="layout_fieldset" title="<?php echo \Lang::get('other.layout.title', array('desc' => $description));?>" onclick="location.href='<?php echo $url;?>';" <?php if(isset($height)) echo 'style="height:',$height,'px;"';?>> 3 <legend class="layout_legend"><?php echo strtoupper($name);?></legend> 4 <div class="layout_section"><?php echo \Lang::get('other.layout.supported');?><span class="layout_info"> <?php echo $type;?></span>.</div> 5 <div class="layout_section"><?php echo \Lang::get('other.layout.count');?><span class="layout_info"> <?php echo $count;?></span>.</div> 5 <fieldset class="layout_fieldset" <?php if(isset($height)) echo 'style="min-height:',$height,'px;"';?>> 6 <legend class="layout_legend"><?php echo strtoupper($name),': <span>',$numbers;?></span> <?php echo \Lang::get('other.layout.widgets');?></legend> 7 <div id="layout_section_<?php echo strtolower($name);?>" > 8 <?php 9 ksort($widgets); 10 foreach($widgets as $widget) 11 { 12 echo '<div id="layout_section_',$widget->id,'_',$widget->modulewidget->id,'" class="layout_widget_selected" title="', $widget->modulewidget->description, '">',$widget->order, '. ', $widget->modulewidget->name,'</div> '; 13 } 14 ?> 15 </div> 6 16 </fieldset> 7 17 </div> -
trunk/modules/exitecms/views/forms/linkset.php
r79 r89 14 14 15 15 // load the edit view for the linkset form 16 echo \View::forge('forms/edit')->set($ view_data, null, false);16 echo \View::forge('forms/edit')->set($__data, null, false); 17 17 ?> 18 18 <script type="text/javascript"> -
trunk/modules/linksets/classes/controller/module.php
r79 r89 17 17 class Controller_Module extends \Exitecms_Module { 18 18 19 /* 20 * Widget options method: select_linkset 21 * 22 * Prompt for the linkset to be displayed in this widget 23 * 24 * @param integer id of the page_section record for which options are set 25 * @return void 26 */ 27 protected function select_linkset($page_section_id) 28 { 29 } 30 19 31 } 20 32 /* End of file module.php */ -
trunk/modules/linksets/classes/controller/multi.php
r79 r89 30 30 public function router() 31 31 { 32 // start the unordered list33 $this->response->body = "\n<ul>";34 35 32 // load the model 36 33 $this->model = \Exitecms\Model_Link::forge(); … … 43 40 if ($root = $this->model->tree_get_root()) 44 41 { 42 // start the unordered list 43 $this->response->body = "\n<ul>"; 44 45 45 $this->response->body .= $this->menu($root); 46 46 } 47 47 } 48 49 return $this->response; 48 50 } 49 51 -
trunk/modules/linksets/classes/controller/single.php
r79 r89 25 25 public function router() 26 26 { 27 // start the unordered list28 $this->response->body = "\n<ul>\n";29 30 27 // load the model 31 28 $model = \Exitecms\Model_Link::forge(); … … 40 37 if ($child = $root->tree_get_first_child($root)) 41 38 { 39 // start the unordered list 40 $this->response->body = "\n<ul>\n"; 41 42 42 do 43 43 { … … 68 68 // close the unordered list 69 69 $this->response->body .= "</ul>\n"; 70 71 return $this->response; 70 72 } 71 73 -
trunk/modules/linksets/config/info.php
r84 r89 115 115 'single' => array( 116 116 'uri' => 'single/index', 117 'description' => 'Linkset widget, displays an unordered list' 117 'description' => 'Linkset widget, displays an unordered list', 118 'method' => 'select_linkset' 118 119 ), 119 120 120 121 'multi' => array( 121 122 'uri' => 'multi/index', 122 'description' => 'Linkset widget, displays an multi-level unordered list' 123 'description' => 'Linkset widget, displays an multi-level unordered list', 124 'method' => 'select_linkset' 123 125 ), 124 126 ), -
trunk/modules/phpinfo/classes/view/phpinfo.php
r81 r89 26 26 elseif(isset($match[3])) 27 27 { 28 $phpinfo[end(array_keys($phpinfo))][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3]; 28 $keys = array_keys($phpinfo); 29 $phpinfo[end($keys)][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3]; 29 30 } 30 31 else 31 32 { 32 $phpinfo[end(array_keys($phpinfo))][] = $match[2]; 33 $keys = array_keys($phpinfo); 34 $phpinfo[end($keys)][] = $match[2]; 33 35 } 34 36 } -
trunk/themes/theme_exitecms/assets/css/default.css
r84 r89 1 1 /* default layout specific */ 2 3 #template_table { 4 } 5 6 #template_table td { 7 border: none; 8 } 9 10 #template_widgets { 11 color: #000; 12 background-color: #bbb; 13 background-image:none; 14 padding: 10px; 15 border: 1px solid #000; 16 width:250px; 17 overflow-x: hidden; 18 overflow-y: scroll; 19 } 20 21 #template_widgets ul { 22 background-color: #eee; 23 list-style: none; 24 padding: 5px; 25 margin: 0; 26 margin-bottom: 5px; 27 } 28 29 #template_widgets ul li { 30 padding: 0; 31 font-weight: bold; 32 } 33 34 #template_widgets ul ul li { 35 padding: 5px; 36 margin: 2px; 37 } 38 39 #template_widgets .layout_widget { 40 border: 1px solid #b6001e; 41 background-color: #ddd; 42 font-weight: normal; 43 cursor: pointer; 44 } 2 45 3 46 #template_layout { … … 7 50 font-size: 90%; 8 51 line-height: 150%; 9 margin: 5px;10 52 padding: 10px; 11 53 border: 1px solid #000; 54 width:600px; 12 55 } 13 56 … … 32 75 } 33 76 77 #template_layout .layout_legend span { 78 color: #b6001e; 79 font-weight:bold; 80 } 81 34 82 #template_layout .layout_fieldset { 35 83 color: #000; 36 84 background-color: #eee; 37 padding:5px;38 85 margin:0px; 39 86 border:1px solid #fff; … … 43 90 } 44 91 45 #template_layout .layout_fieldset:hover { 46 color: #000; 47 background-color: #ccc; 48 cursor:pointer; 49 cursor:hand; 50 border:1px solid #ccc; 51 border-bottom: 1px solid #333; 52 border-right: 1px solid #333; 53 } 54 55 #template_layout .layout_info { 56 color: #b6001e; 57 font-weight:bold; 92 #template_layout .layout_widget, .layout_widget_selected { 93 float: left; 94 border: 1px solid #b6001e; 95 background-color: #ddd; 96 font-weight: normal; 97 padding: 5px; 98 margin: 5px; 99 cursor: pointer; 100 } 101 102 #template_layout .layout_widget_placeholder { 103 float: left; 104 background-color: #b6001e; 105 border: 1px solid #b6001e; 106 font-weight: normal; 107 padding: 5px; 108 margin: 5px; 58 109 } 59 110 -
trunk/themes/theme_exitecms/config/default.php
r72 r89 33 33 'widget' => false, 34 34 ), 35 'max' => 1, 35 36 'layout' => array( 36 37 'description' => 'Header navigation', … … 52 53 'widget' => false, 53 54 ), 55 'max' => 1, 54 56 'layout' => array( 55 57 'description' => 'Main menu navigation', -
trunk/themes/theme_exitecms/views/templates/default.php
r84 r89 13 13 14 14 <!-- Grab Google CDNs jQuery, fall back if necessary --> 15 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1. 4.4/jquery.min.js"></script>16 <script type="text/javascript">!window.jQuery && document.write('<script src="/themes/exitecms/js/jquery-1. 4.4.min.js"><\/script>');</script>15 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> 16 <script type="text/javascript">!window.jQuery && document.write('<script src="/themes/exitecms/js/jquery-1.6.2.min.js"><\/script>');</script> 17 17 18 18 <!-- Form onsubmit function to populate the form with the current crsf token --> … … 30 30 <div id="inner"> 31 31 <div id="header-nav"> 32 <?php echo \ Theme::instance()->widgets('header-nav'); ?>32 <?php echo \ExiteCMS_Themes::instance()->widgets('header-nav'); ?> 33 33 </div> 34 34 <div id="header"></div> 35 35 <div id="main-nav"> 36 <?php echo \ Theme::instance()->widgets('main-nav'); ?>36 <?php echo \ExiteCMS_Themes::instance()->widgets('main-nav'); ?> 37 37 </div> 38 38 <div id="body"> 39 39 <div id="wrapper"> 40 <?php if ( \ Theme::instance()->has_widgets('messages') ) { ?>41 <?php if ( $output = \ Theme::instance()->widgets('messages') ) { ?>40 <?php if ( \ExiteCMS_Themes::instance()->has_widgets('messages') ) { ?> 41 <?php if ( $output = \ExiteCMS_Themes::instance()->widgets('messages') ) { ?> 42 42 <div id="messages"> 43 43 <?php echo $output; ?> … … 45 45 <?php } ?> 46 46 <?php } ?> 47 <?php echo \ Theme::instance()->widgets('body', false); ?>47 <?php echo \ExiteCMS_Themes::instance()->widgets('body', false); ?> 48 48 <div id="content"> 49 <?php echo \ Theme::instance()->widgets('content'); ?>49 <?php echo \ExiteCMS_Themes::instance()->widgets('content'); ?> 50 50 </div> 51 51 </div>
Note: See TracChangeset
for help on using the changeset viewer.
