Changeset 43
- Timestamp:
- 10/02/07 06:34:55 (3 years ago)
- Files:
-
- trunk/src/config/DEFAULT-config.php (modified) (1 diff)
- trunk/src/includes/editam/controllers/page_controller.php (modified) (4 diffs)
- trunk/src/includes/editam/helpers/layout_helper.php (modified) (2 diffs)
- trunk/src/includes/editam/installers/editam_1/profiles/sample_website/profile.php (modified) (1 diff)
- trunk/src/includes/editam/models/page.php (modified) (1 diff)
- trunk/src/includes/editam/models/preferences/core_preferences.php (modified) (1 diff)
- trunk/src/includes/editam/views/admin/_user_menu.tpl (modified) (1 diff)
- trunk/src/includes/editam/views/form_fields/core/_time_zone.tpl (added)
- trunk/src/stylesheets/editam.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/config/DEFAULT-config.php
r11 r43 47 47 defined('AK_ENVIRONMENT') ? null : define('AK_ENVIRONMENT', 'development'); 48 48 49 defined('AK_FRAMEWORK_DIR') ? null : define('AK_FRAMEWORK_DIR', '/home2/akeloso/akelosframework');49 // defined('AK_FRAMEWORK_DIR') ? null : define('AK_FRAMEWORK_DIR', '/path/to/your/akelos'); 50 50 51 51 include_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'boot.php'); trunk/src/includes/editam/controllers/page_controller.php
r15 r43 156 156 $is_new_page = !(!empty($this->params['id']) && $this->Page->id == $this->params['id']); 157 157 $this->is_homepage = !empty($this->params['is_first']) || !$is_new_page && $this->Page->isHomepage(); 158 159 if(!$this->is_homepage && empty($this->ParentPage)){ 160 if($this->ParentPage = $this->Page->nested_set->getRoot()){ 161 $this->params['page']['parent_id'] = $this->ParentPage->getId(); 162 } 163 } 164 158 165 if(!empty($this->params['page'])){ 159 166 $this->Page->setAttributes($this->params['page']); … … 175 182 (empty($this->params['next']) || $this->params['next'] != 'child') ? 176 183 array('action' => 'edit', 'id' => $this->Page->getId()) : 177 array('action' => 'add_child', 'parent_id' => $this->Page->getId()) 184 array('action' => 'add_child', 'parent_id' => $this->Page->getId()) 178 185 ) 179 186 ); 180 187 return ; 181 188 } 182 }183 }elseif(!$this->is_homepage && empty($this->ParentPage)){184 if($this->ParentPage = $this->Page->nested_set->getRoot()){185 $this->params['page']['parent_id'] = $this->ParentPage->getId();186 189 } 187 190 } … … 221 224 { 222 225 $this->layout = false; 223 226 224 227 if(!empty($this->params['content'])){ 225 228 $from = empty($this->params['from']) ? 'html' : $this->params['from']; … … 272 275 $Page->layout->load(); 273 276 $results[$Page->layout->getId()] = $Page->layout->getAttributes()." -- {%= pages_list :first = '/docs', :id = 'menu', :class = 'menu docs' %}"; 274 */277 */ 275 278 $this->layout = false; 276 279 trunk/src/includes/editam/helpers/layout_helper.php
r2 r43 52 52 function language_switch_list($langs = array(), $list_html_options = array(), $list_item_html_options = array()) 53 53 { 54 $default_list_html_options = array('class'=>'language_switch ');54 $default_list_html_options = array('class'=>'language_switch user_actions'); 55 55 $list_html_options = array_merge($default_list_html_options, $list_html_options); 56 56 … … 71 71 { 72 72 return $this->_controller->url_helper->link_to($description, 73 $this->_controller->url_helper->modify_current_url(array('lang'=>$language), array('ak',AK_SESSION_NAME,'AK_SESSID','PHPSESSID' ), false),73 $this->_controller->url_helper->modify_current_url(array('lang'=>$language), array('ak',AK_SESSION_NAME,'AK_SESSID','PHPSESSID','is_first'), false), 74 74 $html_options); 75 75 } trunk/src/includes/editam/installers/editam_1/profiles/sample_website/profile.php
r17 r43 80 80 'filter' => 'markdown', 81 81 'content' => 82 "Please login <a href='{base}/admin'>login</a> using *admin* as your username and password to administer your website.82 "Please login <a href='{base}/admin'>login</a> using the username and password you provided when you installed Editam. 83 83 84 84 Editam is a content management platform based in these core principles and objectives trunk/src/includes/editam/models/page.php
r35 r43 57 57 var $acts_as = array('nested_set' => array('order' => 'virtual DESC, title ASC','scope' => "locale = ?")); 58 58 59 /*60 function __construct()61 {62 $attributes = (array)func_get_args();63 $Page = $this->init($attributes);64 $Page->_fixed_locale = $Page->get('locale');65 }66 */67 68 59 function getLocale() 69 60 { 70 61 $default_lang = Ak::lang(); 71 $lang = empty($this->locale) ? $default_lang : $this->locale;62 $lang = !isset($this->_original_locale) || empty($this->locale) ? $default_lang : $this->locale; 72 63 $locale = in_array($lang, Ak::langs()) ? $lang : $default_lang; 73 64 $this->_original_locale = empty($this->_original_locale) ? $locale : $this->_original_locale; 74 65 return $locale; 66 } 67 68 function forceSetLocale($locale) 69 { 70 $this->_forced_locale = $locale; 75 71 } 76 72 trunk/src/includes/editam/models/preferences/core_preferences.php
r41 r43 72 72 if($config_file != $new_config_file){ 73 73 Ak::file_put_contents(AK_CONFIG_DIR.DS.'config.php', $new_config_file); 74 75 foreach (Ak::toArray($new_langs) as $lang){ 76 $lang = Ak::sanitize_include($lang,'paranoid'); 77 $locale_file = AK_CONFIG_DIR.DS.'locales'.DS.$lang.'.php'; 78 if(!file_exists($locale_file) && !empty($base_locale_file)){ 79 $base_locale = preg_replace('/(\$locale\[[\r\n\s\t]*[\'"]description[\'"][\r\n\s\t]*][\r\n\s\t]*=[\r\n\s\t]*[\'"])(.+)([\'"][\r\n\s\t]*;)/','$1'.$lang.'$3', Ak::file_get_contents($base_locale_file)); 80 Ak::file_put_contents($locale_file, $base_locale); 81 }elseif (empty($base_locale_file)){ 82 $base_locale_file = $locale_file; 83 } 84 } 74 85 } 75 86 } trunk/src/includes/editam/views/admin/_user_menu.tpl
r2 r43 3 3 <li><%= link_to _"preferences", :controller => 'preferences', :action => 'setup' %></li> 4 4 </ul> 5 <%= language_switch_list %> trunk/src/stylesheets/editam.css
r2 r43 267 267 } 268 268 269 .language_switch li a{ color:#777; }270 271 .language_switch li{272 font-size:70%;273 float:right;274 padding:0 3px 0 3px;275 }276 269 277 270 ul.language_switch{ 278 display:block; 279 height:14px; 280 margin:-5px 0 0 0; 271 margin:0 15px 0 0; 281 272 } 282 273
