function display($tpl = null) { $app = JFactory::getApplication(); $document = JFactory::getDocument(); $document->link = JRoute::_(UserNotifyHelperRoute::getCategoryRoute($this->input->getInt('id', null))); $this->input->set('limit', $app->getCfg('feed_limit')); $siteEmail = $app->getCfg('mailfrom'); $fromName = $app->getCfg('fromname'); $document->editor = $fromName; $document->editorEmail = $siteEmail; // Get some data from the model $items = $this->get('Items'); $category = $this->get('Category'); foreach ($items as $item) { // strip html from feed item title $title = $this->escape($item->title); $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8'); // url link to article $link = JRoute::_(UserNotifyHelperRoute::getUserSubsRoute($item->slug, $item->catid)); // strip html from feed item description text $description = $item->description; $date = $item->date ? date('r', strtotime($item->date)) : ''; // load individual item creator class $feeditem = new JFeedItem(); $feeditem->title = $title; $feeditem->link = $link; $feeditem->description = $description; $feeditem->date = $date; $feeditem->category = 'UserNotify'; // loads item info into rss array $document->addItem($feeditem); } }
static function edit($usersubs, $params, $attribs = array()) { $user = JFactory::getUser(); $uri = JFactory::getURI(); if ($params && $params->get('popup')) { return; } if ($usersubs->state < 0) { return; } JHtml::_('behavior.tooltip'); $url = UserNotifyHelperRoute::getFormRoute($usersubs->id, base64_encode($uri)); $icon = $usersubs->state ? 'edit.png' : 'edit_unpublished.png'; $text = JHtml::_('image', 'system/' . $icon, JText::_('JGLOBAL_EDIT'), NULL, true); if ($usersubs->state == 0) { $overlib = JText::_('JUNPUBLISHED'); } else { $overlib = JText::_('JPUBLISHED'); } $date = JHtml::_('date', $usersubs->created); $author = $usersubs->created_by_alias ? $usersubs->created_by_alias : $usersubs->author; $overlib .= '<br />'; $overlib .= $date; $overlib .= '<br />'; $overlib .= htmlspecialchars($author, ENT_COMPAT, 'UTF-8'); $button = JHtml::_('link', JRoute::_($url), $text); $output = '<span class="hasTip" title="' . JText::_('COM_USERNOTIFY_EDIT') . ' :: ' . $overlib . '">' . $button . '</span>'; return $output; }
/** * Prepares the document */ protected function _prepareDocument() { $app = JFactory::getApplication(); $menus = $app->getMenu(); $pathway = $app->getPathway(); $title = null; // Because the application sets a default page title, // we need to get it from the menu item itself $menu = $menus->getActive(); if ($menu) { $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); } else { $this->params->def('page_heading', JText::_('COM_USERNOTIFY_DEFAULT_PAGE_TITLE')); } $id = (int) @$menu->query['id']; if ($menu && ($menu->query['option'] != 'com_usernotify' || $id != $this->category->id)) { $this->params->set('page_subheading', $this->category->title); $path = array(array('title' => $this->category->title, 'link' => '')); $category = $this->category->getParent(); while (($menu->query['option'] != 'com_usernotify' || $id != $category->id) && $category->id > 1) { $path[] = array('title' => $category->title, 'link' => UserNotifyHelperRoute::getCategoryRoute($category->id)); $category = $category->getParent(); } $path = array_reverse($path); foreach ($path as $item) { $pathway->addItem($item['title'], $item['link']); } } $title = $this->params->get('page_title', ''); if (empty($title)) { $title = $app->getCfg('sitename'); } elseif ($app->getCfg('sitename_pagetitles', 0)) { $title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title); } $this->document->setTitle($title); if ($this->category->metadesc) { $this->document->setDescription($this->category->metadesc); } elseif (!$this->category->metadesc && $this->params->get('menu-meta_description')) { $this->document->setDescription($this->params->get('menu-meta_description')); } if ($this->category->metakey) { $this->document->setMetadata('keywords', $this->category->metakey); } elseif (!$this->category->metakey && $this->params->get('menu-meta_keywords')) { $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); } if ($this->params->get('robots')) { $this->document->setMetadata('robots', $this->params->get('robots')); } if ($app->getCfg('MetaTitle') == '1') { $this->document->setMetaData('title', $this->category->getMetadata()->get('page_title')); } if ($app->getCfg('MetaAuthor') == '1') { $this->document->setMetaData('author', $this->category->getMetadata()->get('author')); } $mdata = $this->category->getMetadata()->toArray(); foreach ($mdata as $k => $v) { if ($v) { $this->document->setMetadata($k, $v); } } // Add alternative feed link if ($this->params->get('show_feed_link', 1) == 1) { $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); } }
?> <?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) { if (!isset($this->children[$this->category->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?> > <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(UserNotifyHelperRoute::getCategoryRoute($child->id)); ?> "> <?php echo $this->escape($child->title); ?> </a> </span> <?php if ($this->params->get('show_subcat_desc') == 1) { ?> <?php if ($child->description) { ?> <div class="category-desc">
protected static function _findItem($needles = null) { $app = JFactory::getApplication(); $menus = $app->getMenu('site'); // Prepare the reverse lookup array. if (self::$lookup === null) { self::$lookup = array(); $component = JComponentHelper::getComponent('com_usernotify'); $items = $menus->getItems('component_id', $component->id); foreach ($items as $item) { if (isset($item->query) && isset($item->query['view'])) { $view = $item->query['view']; if (!isset(self::$lookup[$view])) { self::$lookup[$view] = array(); } if (isset($item->query['id'])) { self::$lookup[$view][$item->query['id']] = $item->id; } } } } if ($needles) { foreach ($needles as $view => $ids) { if (isset(self::$lookup[$view])) { foreach ($ids as $id) { if (isset(self::$lookup[$view][(int) $id])) { return self::$lookup[$view][(int) $id]; } } } } } else { $active = $menus->getActive(); if ($active) { return $active->id; } } return null; }
?> <?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) { if (!isset($this->items[$this->parent->id][$id + 1])) { $class = ' class="last"'; } ?> <li<?php echo $class; ?> > <?php $class = ''; ?> <span class="item-title"><a href="<?php echo JRoute::_(UserNotifyHelperRoute::getCategoryRoute($item->id)); ?> "> <?php echo $this->escape($item->title); ?> </a> </span> <?php if ($this->params->get('show_subcat_desc_cat') == 1) { ?> <?php if ($item->description) { ?> <div class="category-desc"> <?php