Changeset 2107 for plugins/apostrophePlugin/trunk
- Timestamp:
- 09/01/10 11:59:43 (21 months ago)
- Location:
- plugins/apostrophePlugin/trunk
- Files:
-
- 13 modified
-
. (modified) (1 prop)
-
config/doctrine/schema.yml (modified) (1 diff)
-
lib/action/BaseaActions.class.php (modified) (1 diff)
-
lib/action/BaseaFeedSlotComponents.class.php (modified) (1 diff)
-
lib/form/BaseaPageSettingsForm.class.php (modified) (2 diffs)
-
lib/model/doctrine/PluginaFeedSlot.class.php (modified) (2 diffs)
-
lib/model/doctrine/PluginaPage.class.php (modified) (4 diffs)
-
lib/toolkit/aHtml.class.php (modified) (1 diff)
-
lib/toolkit/aZendSearch.class.php (modified) (4 diffs)
-
modules/a/templates/settingsSuccess.php (modified) (1 diff)
-
modules/aFeedSlot/templates/_aFeedItem.php (modified) (2 diffs)
-
web/css/a.css (modified) (1 prop)
-
web/images (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
plugins/apostrophePlugin/trunk
- Property svn:mergeinfo changed
/plugins/apostrophePlugin/branches/features/wjohnald (added) merged: 1984,1988,1990,2012,2015,2104-2106
- Property svn:mergeinfo changed
-
plugins/apostrophePlugin/trunk/config/doctrine/schema.yml
r2016 r2107 10 10 - Timestampable 11 11 - NestedSet 12 - Taggable 12 13 columns: 13 14 id: -
plugins/apostrophePlugin/trunk/lib/action/BaseaActions.class.php
r2030 r2107 41 41 $this->page = $page; 42 42 $this->setTemplate($page->template); 43 44 $tagstring = implode(',', $page->getTags()); 45 if (strlen($tagstring)) 46 { 47 $this->getResponse()->addMeta('keywords', htmlspecialchars($tagstring)); 48 } 49 if (strlen($page->getMetaDescription())) 50 { 51 $this->getResponse()->addMeta('description', $page->getMetaDescription()); 52 } 43 53 44 54 return 'Template'; -
plugins/apostrophePlugin/trunk/lib/action/BaseaFeedSlotComponents.class.php
r1868 r2107 34 34 $this->posts = $this->getOption('posts', 5); 35 35 $this->links = $this->getOption('links', true); 36 $this->markup = $this->getOption('markup', '<strong><em><p><br><ul><li> ');36 $this->markup = $this->getOption('markup', '<strong><em><p><br><ul><li><a>'); 37 37 $this->attributes = $this->getOption('attributes', false); 38 38 $this->styles = $this->getOption('styles',false); -
plugins/apostrophePlugin/trunk/lib/form/BaseaPageSettingsForm.class.php
r2016 r2107 93 93 ))); 94 94 95 // Tags 96 $tagstring = implode(', ', $this->getObject()->getTags()); // added a space after the comma for readability 97 // class tag-input enabled for typeahead support 98 $this->setWidget('tags', new sfWidgetFormInput(array('default' => $tagstring), array('class' => 'tags-input'))); 99 $this->setValidator('tags', new sfValidatorString(array('required' => false))); 100 101 102 // Meta Description 103 $metaDescription = $this->getObject()->getMetaDescription(); 104 $this->setWidget('meta_description', new sfWidgetFormTextArea(array('default' => html_entity_decode($metaDescription, ENT_COMPAT, 'UTF-8')))); 105 $this->setValidator('meta_description', new sfValidatorString(array('required' => false))); 106 107 108 95 109 $this->addPrivilegeWidget('edit', 'editors'); 96 110 $this->addPrivilegeWidget('manage', 'managers'); … … 236 250 $object = parent::updateObject($values); 237 251 252 // Update tags on Page 253 if ($this->getValue('tags') != '') 254 { 255 $this->getObject()->addTag($this->getValue('tags')); 256 } 257 258 // Update meta-description on Page 259 if ($this->getValue('meta_description') != '') 260 { 261 $this->getObject()->setMetaDescription(htmlentities($this->getValue('meta_description'))); 262 } 263 238 264 // Check for cascading operations 239 265 if($this->getValue('cascade_archived') || $this->getValue('cascade_view_is_secure')) -
plugins/apostrophePlugin/trunk/lib/model/doctrine/PluginaFeedSlot.class.php
r279 r2107 1 1 2 <?php 2 3 … … 13 14 abstract class PluginaFeedSlot extends BaseaFeedSlot 14 15 { 15 16 16 } -
plugins/apostrophePlugin/trunk/lib/model/doctrine/PluginaPage.class.php
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 that1280 // 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 summaries1285 array(1286 'summary' => $summary,1287 'info' => serialize($info)),1288 // These are stored AND indexed1289 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 -
plugins/apostrophePlugin/trunk/lib/toolkit/aHtml.class.php
r1930 r2107 579 579 { 580 580 sfContext::getInstance()->getConfiguration()->loadHelpers(array('Tag', 'Text')); 581 return auto_link_text(simple_format_text(htmlentities($text, ENT_COMPAT, 'UTF-8')));581 return auto_link_text(simple_format_text(htmlentities($text, ENT_COMPAT, 'UTF-8'))); 582 582 } 583 583 -
plugins/apostrophePlugin/trunk/lib/toolkit/aZendSearch.class.php
r2030 r2107 252 252 // use unStoredFields. For things that need not be indexed at all, like summaries, use unIndexedFields 253 253 254 static public function updateLuceneIndex(Doctrine_Record $object, $ unStoredFields = array(), $culture = null, $unIndexedFields = array(), $storedAndIndexedFields= array())254 static public function updateLuceneIndex(Doctrine_Record $object, $fields = array(), $culture = null, $storedFields = array(), $boostsByField = array()) 255 255 { 256 256 self::deleteFromLuceneIndex($object, $culture); … … 264 264 $doc->addField(Zend_Search_Lucene_Field::Keyword('culture', $culture, 'UTF-8')); 265 265 } 266 // index the UnStoredfields267 foreach ($ unStoredFields as $key => $value)266 // index the search fields 267 foreach ($fields as $key => $value) 268 268 { 269 269 // Ugh: UTF8 Lucene is case sensitive work around this … … 276 276 $value = strtolower($value); 277 277 } 278 $doc->addField(Zend_Search_Lucene_Field::UnStored($key, $value, 'UTF-8')); 278 279 $field = Zend_Search_Lucene_Field::UnStored($key, $value, 'UTF-8'); 280 if (isset($boostsByField[$key])) 281 { 282 $field->boost = $boostsByField[$key]; 283 } 284 $doc->addField($field); 279 285 } 280 286 281 287 // store the data fields (a big performance win over hydrating things with Doctrine) 282 foreach ($ unIndexedFields as $key => $value)288 foreach ($storedFields as $key => $value) 283 289 { 284 290 $doc->addField(Zend_Search_Lucene_Field::UnIndexed($key, $value, 'UTF-8')); 285 }286 287 // index and store the storedAndIndexed fields288 foreach ($storedAndIndexedFields as $key => $value)289 {290 // Ugh: UTF8 Lucene is case sensitive work around this291 if (function_exists('mb_strtolower'))292 {293 $value = mb_strtolower($value);294 }295 else296 {297 $value = strtolower($value);298 }299 $doc->addField(Zend_Search_Lucene_Field::Text($key, $value, 'UTF-8'));300 291 } 301 292 … … 304 295 $index->commit(); 305 296 } 306 297 307 298 // This does a clean job of saving the object in both doctrine and zend 308 299 // without a lot of duplicated code, reducing the potential for -
plugins/apostrophePlugin/trunk/modules/a/templates/settingsSuccess.php
r2077 r2107 55 55 <?php echo $form['template'] ?> 56 56 <?php echo $form['template']->renderError() ?> 57 </div> 58 59 <div class="a-form-row keywords"> 60 <?php echo $form['tags']->renderLabel(__('Page Tags', array(), 'apostrophe')) ?> 61 <?php echo $form['tags'] ?> 62 <?php echo $form['tags']->renderError() ?> 63 </div> 64 65 <div class="a-form-row meta-description"> 66 <?php echo $form['meta_description']->renderLabel(__('Meta Description', array(), 'apostrophe')) ?> 67 <?php echo $form['meta_description'] ?> 68 <?php echo $form['meta_description']->renderError() ?> 57 69 </div> 58 70 -
plugins/apostrophePlugin/trunk/modules/aFeedSlot/templates/_aFeedItem.php
r1914 r2107 1 1 <?php 2 // Pull in the Symfony Text Helper 3 sfContext::getInstance()->getConfiguration()->loadHelpers(array('Text')); 4 2 5 // Compatible with sf_escaping_strategy: true 3 6 $attributes = isset($attributes) ? $sf_data->getRaw('attributes') : null; … … 19 22 <?php $date = $feedItem->getPubDate() ?> 20 23 <li class="date"><?php echo $dateFormat ? date($dateFormat, $date) : aDate::pretty($date) . ' ' . aDate::time($date) ?></li> 21 <li class="description"><?php echo a Html::simplify($feedItem->getDescription(), $markup, false, (isset($attributes)? $attributes:false), (isset($styles)? $styles:false)) ?></li>24 <li class="description"><?php echo auto_link_text(aHtml::simplify($feedItem->getDescription(), $markup, false, (isset($attributes)? $attributes:false), (isset($styles)? $styles:false))) ?></li> 22 25 </ul> 23 26 </li> -
plugins/apostrophePlugin/trunk/web/css/a.css
- Property svn:mergeinfo changed (with no actual effect on merging)
-
plugins/apostrophePlugin/trunk/web/images
- Property svn:mergeinfo changed (with no actual effect on merging)

