Changeset 446
- Timestamp:
- 01/06/08 21:03:23 (12 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
module.inc (modified) (7 diffs)
-
modules/base/classes/cache.php (modified) (3 diffs)
-
modules/base/classes/entityManager.php (modified) (1 diff)
-
modules/base/templates/gallery.tpl (modified) (1 diff)
-
modules/base/templates/options_general.tpl (modified) (1 diff)
-
owa_news.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/module.inc
r439 r446 74 74 $owa_config['authentication'] = 'gallery'; 75 75 $owa_config['site_id'] = md5($gallery_base_url); 76 $owa_config['query_string_filters'] = 'g2_fromNavId'; 76 77 $owa_config['is_embedded'] = 'true'; 77 78 … … 175 176 global $gallery; 176 177 177 // get instance of owa 178 $owa = owa_factory(); 179 180 // set user priviledges of the request for OWA to log 181 owa_set_priviledges(); 182 183 // Setup OWA request params 184 $params = array(); 185 186 // get user gallery's object to set request variables 187 $params['user_name']= $u->userName; 188 $params['user_email'] = $u->email; 178 189 179 if (GalleryUtilities::hasRequestVariable('view')): 190 180 $viewName = GalleryUtilities::getRequestVariables('view'); 181 182 191 183 // ensure this is not a Gallery admin screen 192 if ($viewName != "core.SiteAdmin"): 184 if ($viewName == "core.SiteAdmin" || $viewName == "core.ItemAdmin"): 185 return; 186 else: 187 188 // get instance of owa 189 $owa = owa_factory(); 190 191 // set user priviledges of the request for OWA to log 192 owa_set_priviledges(); 193 194 // Setup OWA request params 195 $params = array(); 196 197 // get user gallery's object to set request variables 198 //$params['user_name']= $u->userName; 199 //$params['user_email'] = $u->email; 193 200 194 201 // get information on current view … … 224 231 } 225 232 233 234 /** 235 * Check to see if OWA is installed and activated 236 * 237 */ 238 function owa_isActivated() { 239 240 list ($ret, $params) = GalleryCoreApi::fetchAllPluginParameters('module', 'owa'); 241 242 if (!empty($params)): 243 return true; 244 else: 245 return false; 246 endif; 247 } 248 249 226 250 /** 227 251 * @see GalleryModule::getSiteAdminViews … … 231 255 global $gallery; 232 256 233 $owa = owa_factory(); 234 235 // set user priviledges of the request for OWA 236 owa_set_priviledges(); 237 257 // this is needed becasue on the plugins page this callback is triggered 258 // whether then plugin is active or not for some reason. 259 //if ($this->owa_isActivated()): 260 // get OWA instance 261 // $owa = owa_factory(); 262 // set user priviledges of the request for OWA 263 // owa_set_priviledges(); 264 //endif; 265 238 266 $data = array(array('name' => $this->translate('Dashboard'), 'view' => 'owa.owaDashboard'), 239 267 array('name' => $this->translate('Admin Settings'), 'view' => 'owa.owaOptions')); … … 292 320 293 321 $params = array(); 294 $params['view'] = 'base.options'; 295 $params['subview'] = 'base.optionsGeneral'; 322 323 if (empty($owa->params['do'])): 324 if (empty($owa->params['view'])): 325 $params['view'] = 'base.options'; 326 $params['subview'] = 'base.optionsGeneral'; 327 endif; 328 endif; 329 296 330 $page = $owa->handleRequest($params); 297 331 $template->setVariable('owa', array('content' => $page)); 298 332 return array(null, array('body' => 'modules/owa/modules/base/templates/gallery.tpl')); 299 333 } 334 335 /** 336 * Does this view change any data? Only controllers should change data, but AJAX and some 337 * immediate views are handled in views in Gallery. 338 * @return bool true if the view changes data 339 */ 340 function isControllerLike() { 341 return true; 342 } 343 300 344 301 345 } … … 343 387 return array(null, array('body' => 'modules/owa/modules/base/templates/gallery.tpl')); 344 388 } 345 389 390 /** 391 * Does this view change any data? Only controllers should change data, but AJAX and some 392 * immediate views are handled in views in Gallery. 393 * @return bool true if the view changes data 394 */ 395 function isControllerLike() { 396 return true; 397 } 398 399 } 400 401 class owaControlController extends GalleryController { 402 403 /** 404 * @see GalleryController::handleRequest 405 */ 406 function handleRequest($form) { 407 408 $result = array('delegate' => array('view' => 'owa.owaGeneric'), 409 'status' => 1, 'error' => ''); 410 return array(null, $result); 411 412 } 413 346 414 } 347 415 … … 395 463 $viewName = GalleryUtilities::getRequestVariables('view'); 396 464 // ensure this is not a Gallery admin screen 397 if ($viewName != "core.SiteAdmin"): 398 399 465 466 if ($viewName == "core.SiteAdmin" || $viewName == "core.ItemAdmin"): 467 return; 468 else: 400 469 /* 2. Load the requested data */ 470 401 471 $owa = owa_factory(); 402 472 $tags = $owa->placeHelperPageTags(false); -
trunk/modules/base/classes/cache.php
r444 r446 107 107 function replace($collection, $key, $value) { 108 108 109 return $this->set($collection, $key, $value); 109 $hkey = $this->hash($key); 110 $this->cache[$collection][$hkey] = $value; 111 $this->debug(sprintf('Replacing Object in Cache - Collection: %s, id: %s', $collection, $hkey)); 112 $this->statistics['replaced']++; 113 114 if (!in_array($collection, $this->non_persistant_collections)): 115 if (!in_array($hkey, $this->dirty_objs[$collection])): 116 $this->dirty_objs[$collection][] = $hkey; 117 //$this->debug(print_r($this->dirty_objs, true)); 118 $this->dirty_collections[$collection] = true; 119 $this->debug(sprintf('Added Object to Dirty List - Collection: %s, id: %s', $collection, $hkey)); 120 $this->statistics['dirty']++; 121 endif; 122 // check to see if cache file exists and remove it just in case the collection 123 // was recently added to the non persistant list. 124 else: 125 $this->removeCacheFile($this->makeCollectionDirPath($collection).$hkey.'.php'); 126 endif; 127 128 129 return; 110 130 } 111 131 … … 189 209 Total Miss: %s 190 210 Total Added to Cache: %s 211 Total Replaced: %s 191 212 Total Persisted: %s 192 213 Total Removed: %s", … … 196 217 $this->statistics['miss'], 197 218 $this->statistics['added'], 219 $this->statistics['replaced'], 198 220 $this->statistics['dirty'], 199 221 $this->statistics['removed']); -
trunk/modules/base/classes/entityManager.php
r438 r446 145 145 if ($status == true): 146 146 if ($this->config['cache_objects'] == true): 147 $this->cache-> set(get_class($this->entity), 'id'.$this->entity->id->value, $this->entity);147 $this->cache->replace(get_class($this->entity), 'id'.$this->entity->id->value, $this->entity); 148 148 endif; 149 149 endif; -
trunk/modules/base/templates/gallery.tpl
r438 r446 1 <input type="hidden" name="{g->formVar var="controller"}" value="owa.owaControl"/> 1 2 {$owa.content} -
trunk/modules/base/templates/options_general.tpl
r435 r446 3 3 <div class="subview_content"> 4 4 5 <form method="post" >5 <form method="post" name="owa_options"> 6 6 7 7 <fieldset name="owa-options" class="options"> -
trunk/owa_news.php
r435 r446 57 57 $this->e = &owa_coreAPI::errorSingleton(); 58 58 $this->crawler = new owa_http; 59 $this->crawler->read_timeout = 10; 59 60 $this->cache_dir = ''; 60 61 $this->date_format = "F j, Y";
