Example #1
0
 function getDisplayIntro()
 {
     if (!($intro = $this->getHeaderRef())) {
         $intro = new Article(AMP_Registry::getDbcon());
         $intro->setDefaults();
         $intro->mergeData(array('publish' => 1, 'title' => $this->getName() . $this->getListNameSuffix(), 'body' => $this->getBlurb(), 'class' => AMP_CONTENT_CLASS_SECTIONHEADER));
     }
     return $intro->getDisplay();
 }
Example #2
0
 function save($data, $options = array())
 {
     $options = array_merge($this->getOptions(), $options);
     $data = $this->validate($data, $options);
     if (!$data) {
         return false;
     }
     $article = new Article(AMP_Registry::getDbcon());
     $article->setDefaults();
     $article->mergeData($data);
     $result = $article->save();
     if (!$result) {
         return false;
     }
     if (isset($options['result_mapping']) && $options['result_mapping']) {
         $update_array[$options['result_mapping']] = $article->id;
         $save_plugin =& $this->udm->registerPlugin('AMP', 'Save');
         $save_plugin->save($update_array);
     }
     return $result;
 }