Changeset 298 for trunk/server/www/app/controllers/galleries_controller.php
- Timestamp:
- 02/23/10 14:09:15 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/www/app/controllers/galleries_controller.php
r297 r298 155 155 )); 156 156 157 // Find out how many requests this gallery has. This determins the type of view 158 $requestCount = $this->Gallery->requestCount($gallery['Gallery']['id'], true); 159 $abbreviate = ($requestCount >= Configure::read('Gallery.abbreviate')); 160 157 161 // Get the children of this gallery 158 // TODO: Do this without recursion below Request because it generates ridiculous amounts of159 // duplicate queries that slow the system *a lot*160 162 $children = $this->Gallery->find('all', array( 161 163 'conditions' => array( … … 174 176 )); 175 177 176 $request['Job'] = $this->Request->Job->find('all', array( 177 'conditions' => array('Job.request_id' => $request['id']), 178 'contain' => array( 179 'Application', 180 'Format', 181 'Platform', 182 'Result', 183 'Result.Validator' 184 ), 185 'order' => array( 186 'Application.name ASC', 187 'Job.version ASC', 188 'Platform.name ASC', 189 'Format.name ASC', 190 ), 191 )); 192 193 // Fix array layout to match a regular query layout 194 foreach ($request['Job'] as &$job) { 195 foreach ($job['Job'] as $attr => $value) { 196 $job[$attr] = $value; 178 if (!$abbreviate) { 179 $request['Job'] = $this->Request->Job->find('all', array( 180 'conditions' => array('Job.request_id' => $request['id']), 181 'contain' => array( 182 'Application', 183 'Format', 184 'Platform', 185 'Result', 186 'Result.Validator' 187 ), 188 'order' => array( 189 'Application.name ASC', 190 'Job.version ASC', 191 'Platform.name ASC', 192 'Format.name ASC', 193 ), 194 )); 195 196 // Fix array layout to match a regular query layout 197 foreach ($request['Job'] as &$job) { 198 foreach ($job['Job'] as $attr => $value) { 199 $job[$attr] = $value; 200 } 201 unset($job['Job']); 197 202 } 198 unset($job['Job']);199 203 } 200 204 } … … 209 213 // Check access 210 214 $access = $this->_checkAccess($slug); 211 $this->set(compact('gallery', 'path', 'access' ));215 $this->set(compact('gallery', 'path', 'access', 'abbreviate')); 212 216 } 213 217
Note: See TracChangeset
for help on using the changeset viewer.