function _formFooter() { $renderer =& AMP_get_renderer(); $current_section_edit_link = false; $current_class_edit_link = false; $base_footer = ' <a href="' . AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('nosearch=1')) . '" class="standout">' . sprintf(AMP_TEXT_VIEW_ALL, AMP_pluralize(ucfirst(AMP_TEXT_ARTICLE))) . '</a>'; //sectional edit link $current_section = isset($_REQUEST['section']) && $_REQUEST['section'] ? $_REQUEST['section'] : false; if (!$current_section) { $current_section = isset($_REQUEST['type']) && $_REQUEST['type'] ? $_REQUEST['type'] : false; } if ($current_section) { $section_names = AMPContent_Lookup::instance('sections'); $section_name = isset($section_names[$current_section]) ? $section_names[$current_section] : false; $current_section_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_SECTION, array('id=' . $current_section)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_SECTION . $renderer->space() . AMP_trimText($section_name, 20, false)); } //class edit link $current_class = isset($_REQUEST['class']) && $_REQUEST['class'] ? $_REQUEST['class'] : false; if ($current_class) { $class_names = AMPContent_Lookup::instance('classes'); $class_name = isset($class_names[$current_class]) ? $class_names[$current_class] : false; $current_class_edit_link = $renderer->separator() . $renderer->link(AMP_Url_AddVars(AMP_SYSTEM_URL_CLASS, array('id=' . $current_class)), $renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => 0)) . $renderer->space() . AMP_TEXT_EDIT . $renderer->space() . AMP_TEXT_CLASS . $renderer->space() . AMP_trimText($class_name, 20, false)); } return $base_footer . $current_section_edit_link . $current_class_edit_link . $renderer->newline(); }
function setBody($body) { if (!$body) { return false; } $body_text = AMP_trimText($body, 255, false); return $this->mergeData(array('comment' => $body_text)); }
function _renderSectionHeader($section) { $section_header =& $section->getHeaderRef(); if (!$section_header) { return false; } $section_header_url = AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('id=' . $section_header->id)); return AMP_TEXT_SECTION_HEADER . ': ' . AMP_trimText($section_header->getName(), 30, false) . $this->_renderer->space(2) . $this->_renderer->link($section_header_url, '[ ' . AMP_TEXT_EDIT . ' ]' . $this->_renderer->space() . $this->_renderer->image(AMP_SYSTEM_ICON_EDIT, array('width' => '16', 'height' => '16', 'border' => '0'))) . $this->_renderer->newline(); }
function render_chevron_display(&$source) { $content = utf8_decode(AMP_trimText($source->getBody(), 700, false)); if ($subtitle = $source->getSubtitle()) { $content = $this->_renderer->italics(AMP_TEXT_SUBTITLE . ': ' . $subtitle) . $this->_renderer->newline() . $content; } if ($contacts = $source->getContacts()) { $content .= $this->_renderer->newline(2) . $this->_renderer->bold(AMP_TEXT_CONTACTS . ': ' . $contacts); } return $content; }
function _contentBox(&$source, $column_name) { $renderer =& $this->_getRenderer(); $content = utf8_decode(AMP_trimText($source->getBody(), 700, false)); if (AMP_CONTENT_RSS_CUSTOMFORMAT) { $content = $this->_customContentDisplay($content, $source); } if ($content) { $content = $renderer->newline(2) . $content; } return $renderer->inDiv($renderer->bold(utf8_decode($source->getName())) . $renderer->newline() . $this->_sourceLink($source) . $this->_itemDate($source) . $content, array('style' => 'padding: 1em;')); }
function galleryLinks($source, $column_name) { $galleries =& AMPContentLookup_GalleriesByImage::instance($source->getName()); if (empty($galleries)) { return false; } $gallerynames = array_combine_key($galleries, AMPContent_Lookup::instance('galleries')); $output = ""; foreach ($galleries as $galleryImage_id => $gallery_id) { if (!isset($gallerynames[$gallery_id])) { continue; } $output .= $this->_HTML_link(AMP_Url_AddVars(AMP_SYSTEM_URL_GALLERY_IMAGE, 'id=' . $galleryImage_id), AMP_trimText($gallerynames[$gallery_id], 30)) . $this->_HTML_newline(); } return $output; }
function amp_articles_tagged($tagname = false) { if (!$tagname) { return false; } $tag_ids = AMP_lookup('tagsSimple'); $found_id = array_keys($tag_ids, strtolower($tagname)); if (!$found_id) { return; } $tag_id = $found_id[0]; require_once 'AMP/Content/Article.inc.php'; $source = new Article(AMP_Registry::getDbcon()); $article_set = $source->find(array('tag' => $tag_id)); $source->sort($article_set, 'itemDate', AMP_SORT_DESC); $renderer = AMP_get_renderer(); foreach ($article_set as $item) { $output .= $renderer->link($item->getURL(), AMP_trimText($item->getName(), 50, false), array('class' => 'sidelist')) . $renderer->newline(); } return $output; }
function publish($section_id, $class_id, $destroy_self = true) { $text = utf8_decode(preg_replace("/\\n/", "<br/>", $this->getBody())); $blurb = AMP_trimText($text, AMP_CONTENT_ARTICLE_BLURB_LENGTH_DEFAULT, false); # this line doesnt work since upgrading adodb? ap #$title = $this->dbcon->qstr( utf8_decode( $this->getName( ))); $title = utf8_decode($this->getName()); $feed_name = $this->getFeedName(); if (!$section_id) { return false; } $article_data = array('title' => $title, 'body' => $text, 'shortdesc' => $blurb, 'uselink' => !AMP_CONTENT_RSS_FULLTEXT, 'linkover' => !AMP_CONTENT_RSS_FULLTEXT, 'link' => $this->getLinkURL(), 'subtitle' => $this->getSubtitle(), 'source' => $feed_name, 'sourceurl' => AMP_validate_url($this->getLinkURL()), 'type' => $section_id, 'class' => $class_id, 'date' => $this->getItemDate(), 'publish' => AMP_CONTENT_STATUS_LIVE, 'enteredby' => AMP_SYSTEM_USER_ID, 'updatedby' => AMP_SYSTEM_USER_ID, 'contact' => $this->getContacts()); require_once 'AMP/Content/Article.inc.php'; $article =& new Article($this->dbcon); $article->setDefaults(); $article->setData($article_data); if (!$article->save()) { return false; } if ($destroy_self) { $this->delete(); } return true; }
function _makeDescription(&$source) { static $blurb_renderer; if (!isset($blurb_renderer)) { if ($this->getData('include_full_content')) { $blurb_renderer = new Article_Public_Detail($source); } else { $blurb_renderer = new Article_Public_List(array($source), array()); } } if (method_exists($blurb_renderer, 'render_body')) { $output = $blurb_renderer->render_body($source); } else { $output = AMP_trimText($blurb_renderer->render_blurb($source), 9000); } return $output; }
function _menuItemArticleList($section_id) { return array('id' => $section_id, 'label' => AMP_trimText(AMP_clearSpecialChars($this->getName($section_id)), 80) . " ( " . $this->getTotals($section_id) . " )", 'href' => AMP_Url_AddVars(AMP_SYSTEM_URL_ARTICLE, array('section=' . $section_id))); }
function _trimText($text) { return AMP_trimText($text, $this->max_text_length, false); }
function render_name($source) { $body = $source->getBody(); return AMP_trimText($body, 70, false); }
function getShortName() { return AMP_trimText($this->getName(), 25, false); }
function render_blurb(&$source) { $blurb = $source->getBlurb(); if (!trim($blurb)) { return false; } return $this->_renderer->span(AMP_trimText($blurb, AMP_CONTENT_ARTICLE_BLURB_LENGTH_MAX), $this->_css_class_text); }
function __construct() { parent::__construct(); foreach ($this->dataset as $id => $name) { $this->dataset[$id] = str_replace(chr(160), ' ', AMP_trimText($name, 60, false)); } }
function render_galleries($data, $column) { if (!isset($data['name'])) { return false; } $gallery_ids = AMP_lookup('galleries_by_image', $data['name']); if (!$gallery_ids) { return false; } $renderer = AMP_get_renderer(); $galleries = array_elements_by_key($gallery_ids, AMP_lookup('galleries')); $gallery_image_ids = array_flip($gallery_ids); $links = array(); asort($galleries); foreach ($galleries as $id => $name) { $links[] = $renderer->link(AMP_url_update(AMP_SYSTEM_URL_GALLERY_IMAGE, array('id' => $gallery_image_ids[$id])), AMP_trimText($name, 30, $tags = false), array('title' => $name)); } return 'Linked Galleries: ' . $renderer->UL($links, array('class' => 'linked_items')); }
function render_blurb($source) { return $this->_renderer->span(AMP_trimText($source->getBlurb(), AMP_CONTENT_ARTICLE_BLURB_LENGTH_MAX), array('class' => AMP_CONTENT_CSS_CLASS_LIST_ARTICLE_TEXT)); }
echo "CHECKED"; } ?> > <br> <a href="#" onclick="new Effect.SlideDown('comment_list');return false;">View /Edit Comments</a> <div id="comment_list" style="display:none;"><div> <?php if ($coms->RecordCount() > 0) { while (!$coms->EOF) { echo '- ' . AMP_trimText($coms->Fields("comment"), 100, false) . '<a href="comments.php?id=' . $coms->Fields("id") . '" target="_new">edit</a><br>'; $coms->MoveNext(); } ?> <br> <br> <a href="comments.php?action=list&cid=<?php echo $_GET[id]; ?> &Search=Search" target="_blank" class="text">List Page</a> <?php } else { echo "no comments"; } ?> </div></div> </td> </tr>
function shortComment($text, $fieldname, $row_data) { return AMP_trimText($text, 70, false); }
function _trimSetting($value, $fieldname, $data) { return AMP_trimText($value, 60, false); }
function _HTML_listItemBlurb($blurb) { if (!trim($blurb)) { return false; } return $this->_HTML_inSpan(AMP_trimText($blurb, $this->_max_blurb_length), $this->_css_class_text); }
function _makeDescription(&$source) { if ($this->getData('include_full_content')) { $output = $this->_display->render_body($source); } else { $output = AMP_trimText($this->_display->render_blurb($source), 9000); } return $output; }
function render_gallery_link($gallery_image_id, $name) { return $this->_renderer->link(AMP_url_update(AMP_SYSTEM_URL_GALLERY_IMAGE, array('id' => $gallery_image_id)), AMP_trimText($name, 30), array('title' => $name)); }