To participate you must create an account on apostrophenow.org. If you have already done so, click Login.
- Timestamp:
- 09/01/10 11:59:43 (21 months ago)
- Author:
- wjohnald
- Message:
-
this commit resolves tickets: #144 and #347
- Location:
- plugins/apostrophePlugin/trunk
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
- Property svn:mergeinfo changed
-
|
r2085
|
r2107
|
|
| 246 | 246 | return $title; |
| 247 | 247 | } |
| | 248 | |
| | 249 | public function getMetaDescription() |
| | 250 | { |
| | 251 | $metaDescriptionSlot = $this->getSlot('metaDescription'); |
| | 252 | |
| | 253 | $result = ''; |
| | 254 | if ($metaDescriptionSlot) |
| | 255 | { |
| | 256 | $result = $metaDescriptionSlot->value; |
| | 257 | } |
| | 258 | return trim($result); |
| | 259 | } |
| | 260 | |
| | 261 | |
| 248 | 262 | |
| 249 | 263 | // Changed in 1.5: returns a flat array, not an associative array indexed by version. |
| … |
… |
|
| 866 | 880 | } |
| 867 | 881 | |
| | 882 | public function setMetaDescription($description) |
| | 883 | { |
| | 884 | $slot = $this->createSlot('aText'); |
| | 885 | $slot->value = $description; |
| | 886 | $slot->save(); |
| | 887 | |
| | 888 | $this->newAreaVersion('metaDescription', 'update', |
| | 889 | array( |
| | 890 | 'permid' => 1, |
| | 891 | 'slot' => $slot)); |
| | 892 | |
| | 893 | } |
| | 894 | |
| | 895 | |
| 868 | 896 | // SAVE ANY CHANGES to the actual page object FIRST before you call this method. |
| 869 | 897 | |
| … |
… |
|
| 1271 | 1299 | $summary = $this->getSearchSummary(); |
| 1272 | 1300 | $text = $this->getSearchText(); |
| | 1301 | $tags = implode(',', $this->getTags()); |
| | 1302 | $metaDescription = $this->getMetaDescription(); |
| 1273 | 1303 | $slug = $this->getSlug(); |
| 1274 | 1304 | $info = $this->getInfo(); |
| … |
… |
|
| 1277 | 1307 | // it lets us check explicit privileges |
| 1278 | 1308 | unset($info['title']); |
| 1279 | | // These are indexed but not stored. Use for fat fields that |
| 1280 | | // would otherwise turn Lucene into a database (it's a terrible database) |
| 1281 | 1309 | aZendSearch::updateLuceneIndex($this, |
| 1282 | | array('text' => $text), |
| | 1310 | array('text' => $text, 'tags' => $tags, 'metadescription' => $metaDescription), |
| 1283 | 1311 | $this->getCulture(), |
| 1284 | | // These are stored, not indexed. They are used to present and filter summaries |
| 1285 | | array( |
| 1286 | | 'summary' => $summary, |
| 1287 | | 'info' => serialize($info)), |
| 1288 | | // These are stored AND indexed |
| 1289 | 1312 | array( |
| 1290 | 1313 | 'title' => $title, |
| 1291 | | 'slug' => $slug |
| 1292 | | )); |
| | 1314 | 'summary' => $summary, |
| | 1315 | 'slug' => $slug, |
| | 1316 | 'info' => serialize($info)), |
| | 1317 | array('tags' => 2.0, 'metadescription' => 1.2)); |
| 1293 | 1318 | } |
| 1294 | 1319 | |
Download in other formats: