/** * Return data on a course view (this will be some form of HTML) * * @param object $course Current course * @param object $offering Name of the component * @param boolean $describe Return plugin description only? * @return object */ public function onCourse($course, $offering, $describe = false) { if (!$offering->access('manage', 'section')) { return; } $response = with(new \Hubzero\Base\Object())->set('name', $this->_name)->set('title', Lang::txt('PLG_COURSES_' . strtoupper($this->_name)))->set('description', Lang::txt('PLG_COURSES_' . strtoupper($this->_name) . '_BLURB'))->set('default_access', $this->params->get('plugin_access', 'managers'))->set('display_menu_tab', true)->set('icon', 'f083'); if ($describe) { return $response; } $nonadmin = Request::getState('com_courses.offering' . $offering->get('id') . '.nonadmin', 0); if (!($active = Request::getVar('active')) && !$nonadmin) { Request::setVar('active', $active = $this->_name); } if ($response->get('name') == $active) { // Set the page title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_COURSES_' . strtoupper($this->_name))); Pathway::append(Lang::txt('PLG_COURSES_' . strtoupper($this->_name)), $offering->link() . '&active=' . $this->_name); $view = with($this->view('default', 'overview'))->set('option', Request::getVar('option', 'com_courses'))->set('course', $course)->set('offering', $offering)->set('params', $this->params); foreach ($this->getErrors() as $error) { $view->setError($error); } $response->set('html', $view->loadTemplate()); } // Return the output return $response; }
/** * Display default page * * @return void */ public function defaultTask() { $config = $this->config; if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } $this->view->config = $config; $this->view->display(); }
/** * Display default page * * @return void */ public function homeTask() { // get categories $categories = $this->warehouse->getRootCategories(); $this->view->categories = $categories; if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } $this->view->display(); }
/** * display */ public function displayTask() { Pathway::append(Lang::txt('COM_GEOSEARCH_TITLE'), 'index.php?option=' . $this->_option); Document::setTitle(Lang::txt('COM_GEOSEARCH_TITLE')); $filters = array(); $filters['limit'] = 1000; //Request::getInt('limit', 1000, 'request'); $filters['start'] = 0; //Request::getInt('limitstart', 0, 'request'); $resources = Request::getVar('resource', '', 'request'); $tags = trim(Request::getString('tags', '', 'request')); $distance = Request::getInt('distance', '', 'request'); $location = Request::getVar('location', '', 'request'); $unit = Request::getVar('dist_units', '', 'request'); $this->view->display(); }
/** * Return data on a course view (this will be some form of HTML) * * @param object $course Current course * @param object $offering Name of the component * @param boolean $describe Return plugin description only? * @return object */ public function onCourse($course, $offering, $describe = false) { $response = with(new \Hubzero\Base\Object())->set('name', $this->_name)->set('title', Lang::txt('PLG_COURSES_' . strtoupper($this->_name)))->set('description', Lang::txt('PLG_COURSES_' . strtoupper($this->_name) . '_BLURB'))->set('default_access', $this->params->get('plugin_access', 'members'))->set('display_menu_tab', true)->set('icon', 'f095'); if ($describe) { return $response; } if (!($active = Request::getVar('active'))) { Request::setVar('active', $active = $this->_name); } // Get a student count $response->set('meta_count', $offering->announcements(array('count' => true))); // Check if our area is in the array of areas we want to return results for if ($response->get('name') == $active) { // Set some variables so other functions have access $this->option = Request::getCmd('option', 'com_courses'); $this->course = $course; $this->offering = $offering; // Set the page title Document::setTitle(Document::getTitle() . ': ' . Lang::txt('PLG_COURSES_ANNOUNCEMENTS')); Pathway::append(Lang::txt('PLG_COURSES_' . strtoupper($this->_name)), $this->offering->link() . '&active=' . $this->_name); require_once Component::path('com_courses') . DS . 'models' . DS . 'announcement.php'; $action = Request::getWord('action', ''); switch (strtolower($action)) { case 'save': $response->set('html', $this->_save()); break; case 'new': $response->set('html', $this->_edit()); break; case 'edit': $response->set('html', $this->_edit()); break; case 'delete': $response->set('html', $this->_delete()); break; default: $response->set('html', $this->_list()); break; } } // Return the output return $response; }
/** * Output tab controls for resource plugins (sub views) * * @param string $option Component name * @param string $id Publication ID * @param array $cats Active plugins' names * @param string $active Current plugin name * @param string $alias Publication alias * @param string $version Publication version * @return string HTML */ public static function tabs($option, $id, $cats, $active = 'about', $alias = '', $version = '') { $html = ''; $html .= "\t" . '<ul class="sub-menu">' . "\n"; $i = 1; foreach ($cats as $cat) { $name = key($cat); /*if ($name == 'usage') { continue; }*/ if ($name != '') { if ($alias) { $url = Route::url('index.php?option=' . $option . '&alias=' . $alias . '&active=' . $name); } else { $url = Route::url('index.php?option=' . $option . '&id=' . $id . '&active=' . $name); } if ($version && $version != 'default') { $url .= '?v=' . $version; } if (strtolower($name) == $active) { Pathway::append($cat[$name], $url); if ($active != 'about') { $title = Document::getTitle(); Document::setTitle($title . ': ' . $cat[$name]); } } $html .= "\t\t" . '<li id="sm-' . $i . '"'; $html .= strtolower($name) == $active ? ' class="active"' : ''; $html .= '><a class="tab" href="' . $url . '"><span>' . $cat[$name] . '</span></a></li>' . "\n"; $i++; } } $html .= "\t" . '</ul>' . "\n"; return $html; }
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @author Shawn Rice <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SPECIAL_FIX_LENGTH'), $this->page->link()); $database = App::get('db'); $query = "SELECT wv.id, wv.pageid, wv.pagetext FROM `#__wiki_version` AS wv WHERE wv.length = '0'"; $database->setQuery($query); $rows = $database->loadObjectList(); ?> <form method="get" action="<?php echo Route::url($this->page->link()); ?> "> <p> <?php echo Lang::txt('COM_WIKI_SPECIAL_FIX_LENGTH_ABOUT'); ?> </p> <div class="container">
/** * Build the "trail" * * @return void */ protected function _buildPathway() { if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } Pathway::append(Lang::txt('COM_PUBLICATIONS_CURATION'), 'index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=display'); if ($this->_pub) { Pathway::append($this->_pub->title, 'index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&task=view' . '&id=' . $this->_pub->id); } }
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SPECIAL_RECENT_CHANGES'), $this->page->link()); $dir = strtoupper(Request::getVar('dir', 'DESC')); if (!in_array($dir, array('ASC', 'DESC'))) { $dir = 'DESC'; } $filters = array('state' => array(0, 1)); if ($space = Request::getVar('namespace', '')) { $filters['namespace'] = urldecode($space); } $rows = $this->book->pages($filters)->including(['versions', function ($version) { $version->select('id')->select('page_id')->select('version')->select('created_by')->select('summary'); }])->order('modified', $dir)->paginated()->rows(); $altdir = $dir == 'ASC' ? 'DESC' : 'ASC'; ?> <form method="get" action="<?php echo Route::url($this->page->link());
/** * Sets the title and pathway based on the current task * * @return void */ private function setTitle() { \Document::setTitle(Lang::txt('COM_MEMBERS_CREDENTIALS_' . ucfirst($this->_task))); \Pathway::append(Lang::txt('COM_MEMBERS_CREDENTIALS_' . ucfirst($this->_task)), 'index.php?option=' . $this->_option . '&task=' . $this->_task); }
/** * Method to set the document path * * @return void */ protected function _buildPathway() { if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } if ($this->_task) { Pathway::append(Lang::txt(strtoupper($this->_option) . '_' . strtoupper($this->_task)), 'index.php?option=' . $this->_option . '&task=' . $this->_task); } }
/** * Display default page * * @return void */ public function homeTask() { $cart = new CurrentCart(); //print_r($this); die; // Initialize errors array $errors = array(); // Update cart if needed $updateCartRequest = Request::getVar('updateCart', false, 'post'); // If pIds are posted, convert them to SKUs $pIds = Request::getVar('pId', false, 'post'); //print_r($pIds); die; $skus = Request::getVar('skus', false, 'post'); if ($updateCartRequest && ($pIds || $skus)) { if (!empty($pIds)) { $skus = array(); $warehouse = new Warehouse(); foreach ($pIds as $pId => $qty) { $product_skus = $warehouse->getProductSkus($pId); // each pId must map to one SKU, otherwise ignored, since there is no way which SKU is being added // Must be only one sku... if (sizeof($product_skus) != 1) { continue; } $skus[$product_skus[0]] = $qty; } } else { if (!is_array($skus)) { $skus = array($skus => 1); } } //print_r($skus); die; // Turn off syncing to prevent redundant session update queries $cart->setSync(false); foreach ($skus as $sId => $qty) { try { $cart->update($sId, $qty); } catch (\Exception $e) { $cart->setMessage($e->getMessage(), 'error'); } } // set flag to redirect $redirect = true; if ($cart->hasMessages()) { $redirect = false; } } else { $allPost = Request::request(); foreach ($allPost as $var => $val) { if ($val == 'delete') { $toDelete = explode('_', $var); if ($toDelete[0] == 'delete') { $sId = $toDelete[1]; // Delete the requested item by setting its QTY to zero $redirect = true; try { $cart->update($sId, 0); } catch (\Exception $e) { $cart->setMessage($e->getMessage(), 'error'); $redirect = false; } } } } } // Add coupon if needed $addCouponRequest = Request::getVar('addCouponCode', false, 'post'); $couponCode = Request::getVar('couponCode', false, 'post'); if ($addCouponRequest && $couponCode) { // Sync cart before pontial coupons applying $cart->getCartInfo(true); // Add coupon try { $cart->addCoupon($couponCode); } catch (\Exception $e) { $cart->setMessage($e->getMessage(), 'error'); } // set flag to redirect $redirect = true; if ($cart->hasMessages()) { $redirect = false; } } // Check for express add to cart if (!empty($redirect) && $redirect) { // If this is an express checkout (go to the confirm page right away) there shouldn't be any items in the cart // Since redirect is set, there are no errors $expressCheckout = Request::getVar('expressCheckout', false, 'post'); // make sure the cart is empty if ($expressCheckout && !empty($skus) && $cart->isEmpty()) { // Get the latest synced cart info, it will also enable cart syncing that was turned off before $cart->getCartInfo(true); // Redirect directly to checkout, skip the cart page App::redirect(Route::url('index.php?option=' . $this->_option) . DS . 'checkout'); } // prevent resubmitting form by refresh // redirect to cart App::redirect(Route::url('index.php?option=' . $this->_option)); } // Get the latest synced cart info, it will also enable cart syncing that was turned off before $cartInfo = $cart->getCartInfo(true); $this->view->cartInfo = $cartInfo; // Handle coupons $couponPerks = $cart->getCouponPerks(); //print_r($couponPerks); die; $this->view->couponPerks = $couponPerks; // Handle memberships $membershipInfo = $cart->getMembershipInfo(); //print_r($membershipInfo); die; $this->view->membershipInfo = $membershipInfo; // At this point the cart is lifted and may have some issues/errors (say, after merging), get them if ($cart->hasMessages()) { $cartMessages = $cart->getMessages(); $this->view->notifications = $cartMessages; } if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } $this->view->display(); }
/** * Fix pathway * * @param object $page * * @return string */ public function fixupPathway() { Pathway::clear(); // Add group if ($this->model->groupOwner()) { Pathway::append(Lang::txt('COM_PROJECTS_GROUPS_COMPONENT'), Route::url('index.php?option=com_groups')); Pathway::append(\Hubzero\Utility\String::truncate($this->model->groupOwner('description'), 50), Route::url('index.php?option=com_groups&cn=' . $this->model->groupOwner('cn'))); Pathway::append(Lang::txt('COM_PROJECTS_PROJECTS'), Route::url('index.php?option=com_groups&cn=' . $this->model->groupOwner('cn') . '&active=projects')); } else { Pathway::append(Lang::txt('COMPONENT_LONG_NAME'), Route::url('index.php?option=' . $this->_option)); } if ($this->model->exists()) { Pathway::append(stripslashes($this->model->get('title')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias'))); } if ($this->_tool && $this->_tool->id) { Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_PANEL_TOOLS')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools')); Pathway::append(\Hubzero\Utility\String::truncate($this->_tool->title, 50), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools&tool=' . $this->_tool->id)); Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_TOOLS_TAB_WIKI')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=tools&tool=' . $this->_tool->id . '&action=wiki')); } else { Pathway::append(ucfirst(Lang::txt('COM_PROJECTS_TAB_NOTES')), Route::url('index.php?option=' . $this->_option . '&alias=' . $this->model->get('alias') . '&active=notes')); } }
/** * View of item * * @return string */ public function item() { // Incoming $todoid = $this->_todoid ? $this->_todoid : Request::getInt('todoid', 0); $layout = $this->_task == 'edit' || $this->_task == 'new' ? 'edit' : 'default'; // Check permission if ($this->_task == 'edit' && !$this->model->access('content')) { throw new Exception(Lang::txt('ALERTNOTAUTH'), 403); return; } $view = new \Hubzero\Plugin\View(array('folder' => $this->_type, 'element' => $this->_name, 'name' => 'item', 'layout' => $layout)); $view->option = $this->option; $view->todo = $this->todo; $view->params = $this->model->params; $view->model = $this->model; // Get team members (to assign items to) $objO = $this->model->table('Owner'); $view->team = $objO->getOwners($this->model->get('id'), $tfilters = array('status' => 1)); if (isset($this->entry) && is_object($this->entry)) { $view->row = $this->entry; } else { $view->row = $this->todo->entry($todoid); } if (!$view->row->exists() && $this->_task != 'new') { return $this->page(); } // Append breadcrumbs Pathway::append(stripslashes(\Hubzero\Utility\String::truncate($view->row->get('content'), 40)), Route::url($this->model->link('todo') . '&action=view&todoid=' . $todoid)); $view->uid = $this->_uid; $view->title = $this->_area['title']; $view->list = Request::getVar('list', ''); $view->ajax = Request::getVar('ajax', 0); return $view->loadTemplate(); }
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access defined('_HZEXEC_') or die; if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->option)), 'index.php?option=' . $this->option); } Pathway::append(\Hubzero\Utility\String::truncate(strip_tags($this->question->get('subject')), 50), $this->question->link()); Document::setTitle(Lang::txt('COM_ANSWERS') . ': ' . strip_tags($this->question->get('subject'))); $this->css()->js(); ?> <header id="content-header"> <h2><?php echo Lang::txt('COM_ANSWERS'); ?> </h2> <div id="content-header-extra"> <p> <a class="icon-search search btn" href="<?php echo Route::url('index.php?option=' . $this->option . '&task=search'); ?> ">
<?php } ?> <section class="course section"> <div class="subject"> <ul class="sub-menu"> <?php if ($action == 'addpage') { $this->active = ''; } if ($this->plugins) { foreach ($this->plugins as $i => $plugin) { $url = Route::url($this->course->link() . '&active=' . $plugin->get('name')); if ($plugin->get('name') == $this->active) { Pathway::append($plugin->get('title'), $url); if ($this->active != 'overview') { Document::setTitle(Document::getTitle() . ': ' . $plugin->get('title')); } } ?> <li id="sm-<?php echo $i; ?> "<?php echo $plugin->get('name') == $this->active ? ' class="active"' : ''; ?> > <a class="tab" data-rel="<?php echo $plugin->get('name'); ?>
/** * Build the "trail" * * @return void */ protected function _buildPathway() { if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } if (!empty($this->model) && $this->_identifier && ($this->_task == 'view' || $this->_task == 'serve' || $this->_task == 'wiki')) { $url = $this->_route; // Link to category Pathway::append($this->model->_category->name, 'index.php?option=' . $this->_option . '&category=' . $this->model->_category->url_alias); // Link to publication if ($this->_version && $this->_version != 'default') { $url .= '&v=' . $this->_version; } Pathway::append($this->model->version->title, $url); if ($this->_task == 'serve' || $this->_task == 'wiki') { Pathway::append(Lang::txt('COM_PUBLICATIONS_SERVING_CONTENT'), $this->_route . '&task=' . $this->_task); } } elseif (Pathway::count() <= 1 && $this->_task) { switch ($this->_task) { case 'browse': case 'submit': if ($this->_task_title) { Pathway::append($this->_task_title, 'index.php?option=' . $this->_option . '&task=' . $this->_task); } break; case 'start': if ($this->_task_title) { Pathway::append($this->_task_title, 'index.php?option=' . $this->_option . '&task=submit'); } break; case 'block': case 'intro': // Nothing break; default: Pathway::append(Lang::txt(strtoupper($this->_option . '_' . $this->_task)), 'index.php?option=' . $this->_option . '&task=' . $this->_task); break; } } }
[!] - (zooley) Added NotFoundError class because PHP was throwing fatal error that the class was not found (irony?). */ if (!class_exists('NotFoundError')) { class NotFoundError extends InvalidArgumentException { } } foreach (array('SCRIPT_URL', 'URL', 'REDIRECT_SCRIPT_URL', 'REDIRECT_URL') as $k) { if (isset($_SERVER[$k])) { $base = $_SERVER[$k]; break; } } $basePath = preg_replace('#^' . preg_quote(PATH_ROOT) . '#', '', __DIR__); \Pathway::append('Search', $base); function hgView($view, $args = array()) { header('Content-type: text/json'); echo HubgraphClient::execView($view, array_merge($_GET, $args)); exit; } function p($num, $label) { return Inflect::pluralizeIf($num, $label); } function h($str) { return htmlentities($str); } function a($str)
/** * Event call for displaying usage data * * @param string $option Component name * @param string $task Component task * @param object $db JDatabase * @param array $months Month names (Jan -> Dec) * @param array $monthsReverse Month names in reverse (Dec -> Jan) * @param string $enddate Time period * @return string HTML */ public function onUsageDisplay($option, $task, $db, $months, $monthsReverse, $enddate) { // Check if our task is the area we want to return results for if ($task) { if (!in_array($task, $this->onUsageAreas()) && !in_array($task, array_keys($this->onUsageAreas()))) { return ''; } } // Incoming $lat = Request::getVar('lat', '35'); $long = Request::getVar('long', '-90'); $zoom = Request::getVar('zoom', ''); if ($lat != '35' && $long != '-90') { $zoom = '14'; } else { $zoom = '4'; } $type = Request::getVar('type', 'online'); $no_html = Request::getVar('no_html', 0); $type = str_replace(':', '-', $type); if ($no_html) { $data = Request::getVar('data', ''); if ($data) { $this->getData($data); } else { $config = Component::params($option); $key = $config->get('mapsApiKey'); $mappath = $config->get('maps_path'); if (is_file(__DIR__ . DS . $type . '.php')) { include_once __DIR__ . DS . $type . '.php'; } else { App::abort(500, Lang::txt('PLG_USAGE_MAPS_TYPE_NOT_FOUND', $type)); return; } return $html; } } Pathway::append(Lang::txt('PLG_USAGE_MAPS_' . strtoupper($type)), 'index.php?option=' . $option . '&task=' . $task . '&type=' . $type); $html = '<h3>' . Lang::txt('PLG_USAGE_MAPS_' . strtoupper($type)) . '</h3>' . "\n"; $html .= '<p><a class="map" href="' . Route::url('index.php?option=' . $option . '&task=maps&type=' . $type) . '">' . Lang::txt('PLG_USAGE_MAPS_RESET') . '</a></p>'; $html .= '<iframe src="' . Route::url('index.php?option=' . $option . '&task=' . $task . '&type=' . $type . '&no_html=1&lat=' . $lat . '&long=' . $long . '&zoom=' . $zoom) . '" width="100%" height="600px" scrolling="no" frameborder="0" title="' . Lang::txt('PLG_USAGE_MAPS_' . strtoupper($type)) . '"></iframe>' . "\n"; return $html; }
/** * Display the form allowing to edit a citation * * @return string HTML */ private function editAction($row = null) { // Check if they're logged in if (User::isGuest()) { return $this->loginAction(); } if (!$this->params->get('access-manage')) { throw new Exception(Lang::txt('PLG_MEMBERS_CITATIONS_NOT_AUTHORIZED'), 403); } // Create view object $view = $this->view('edit'); $view->member = $this->member; $view->option = $this->option; $view->database = $this->database; $view->allow_tags = $this->member->getParam('citation_allow_tags', 'yes'); $view->allow_badges = $this->member->getParam('citatoin_allow_badges', 'yes'); // Get the citation types $citationsType = \Components\Citations\Models\Type::all(); $view->types = $citationsType->rows(); $fields = array(); foreach ($view->types as $type) { if (isset($type->fields)) { $f = $type->fields; if (strpos($f, ',') !== false) { $f = str_replace(',', "\n", $f); } $f = array_map('trim', explode("\n", $f)); $f = array_values(array_filter($f)); $fields[strtolower(str_replace(' ', '', $type->type_title))] = $f; } } // Incoming $id = Request::getInt('cid', 0); // Load the object if (is_object($row)) { $view->row = $row; } else { $view->row = \Components\Citations\Models\Citation::oneOrNew($id); // check to see if this member created this citation if (!$view->row->isNew() && ($view->row->uid != User::get('id') || $view->row->scope != 'member')) { // redirect App::redirect(Route::url($this->member->getLink() . '&active=' . $this->_name), Lang::txt('PLG_MEMBERS_CITATIONS_OWNER_ONLY'), 'warning'); } } //make sure title isnt too long $maxTitleLength = 30; $shortenedTitle = strlen($view->row->title) > $maxTitleLength ? substr($view->row->title, 0, $maxTitleLength) . '…' : $view->row->title; // Set the pathway if ($id && $id != 0) { Pathway::append($shortenedTitle, 'index.php?option=com_citations&task=view&id=' . $view->row->id); Pathway::append(Lang::txt('PLG_MEMBERS_CITATIONS_EDIT')); } else { Pathway::append(Lang::txt('PLG_MEMBERS_CITATIONS_ADD')); } // Set the page title Document::setTitle(Lang::txt('PLG_MEMBERS_CITATIONS_CITATION') . $shortenedTitle); //push jquery to doc Document::addScriptDeclaration('var fields = ' . json_encode($fields) . ';'); // Instantiate a new view $view->title = Lang::txt('PLG_MEMBERS_CITATIONS') . ': ' . Lang::txt('PLG_MEMBERS_CITATIONS_' . strtoupper($this->action)); // No ID, so we're creating a new entry // Set the ID of the creator if (!$id) { $view->row->uid = User::get('id'); //tags & badges $view->tags = array(); $view->badges = array(); $view->row->id = -time(); } else { if ($view->row->relatedAuthors->count()) { $view->authors = $view->row->relatedAuthors; } elseif ($view->row->relatedAuthors->count() == 0 && $view->row->author != '') { // formats the author for the multi-author plugin $authors = explode(';', $view->row->author); $authorString = ''; $totalAuths = count($authors); $x = 0; foreach ($authors as &$author) { /*** * Because the multi-select keys off of a comma, * imported entries may display incorrectly (Wojkovich, Kevin) breaks the multi-select * Convert this to Kevin Wojkovich and I'll @TODO add some logic in the formatter to * format it properly within the bibilographic format ({LASTNAME},{FIRSTNAME}) ***/ $authorEntry = explode(',', $author); if (count($authorEntry == 2)) { $author = $authorEntry[1] . ' ' . $authorEntry[0]; } $authorString .= $author; if ($totalAuths > 1 && $x < $totalAuths - 1) { $authorString .= ','; } $x = $x + 1; } $view->authorString = $authorString; } //tags & badges $view->tags = \Components\Citations\Helpers\Format::citationTags($view->row, $this->database, false); $view->badges = \Components\Citations\Helpers\Format::citationBadges($view->row, $this->database, false); } // Output HTML foreach ($this->getErrors() as $error) { $view->setError($error); } return $view->loadTemplate(); }
$k = array(); // Loop through each sub-category foreach ($cat['_sub'] as $subcat) { // Only show sub-categories that returned search results if ($subcat['total'] > 0) { // If we have a specific category, prepend it to the search term if ($subcat['category']) { $blob = $subcat['category'] . ':' . $this->period; } else { $blob = $this->period; } // Is this the active category? $a = ''; if ($subcat['category'] == $this->active) { $a = ' class="active"'; Pathway::append($subcat['title'], 'index.php?option=' . $this->option . '&period=' . urlencode(stripslashes($blob))); } // Build the HTML $k[] = "\t\t\t" . '<li' . $a . '><a href="' . Route::url('index.php?option=' . $this->option . '&period=' . urlencode(stripslashes($blob))) . '">' . $this->escape($subcat['title']) . ' <span class="item-count">' . $subcat['total'] . '</span></a></li>'; } } // Do we actually have any links? // NOTE: this method prevents returning empty list tags "<ul></ul>" if (count($k) > 0) { $l .= "\t\t" . '<ul>' . "\n"; $l .= implode("\n", $k); $l .= "\t\t" . '</ul>' . "\n"; } } $l .= '</li>'; $links[] = $l;
<?php if (!$this->page) { ?> <div class="pages-content"> <div id="pages-introduction"> <div class="instructions"> <p><?php echo Lang::txt('PLG_COURSES_PAGES_NONE_FOUND'); ?> </p> </div> </div> </div><!-- / .pages-content --> <?php } else { Pathway::append(stripslashes($this->page->get('title')), $base . '&unit=' . $this->page->get('url')); $authorized = false; if ($this->page->get('offering_id')) { // If they're a course level manager if ($this->offering->access('manage')) { $authorized = true; } else { if ($this->offering->access('manage', 'section') && $this->page->get('section_id')) { $authorized = true; } } } ?> <?php if ($authorized) { ?>
if (isset($cat['children']) && is_array($cat['children'])) { // An array for storing the HTML we make $k = array(); // Loop through each sub-category foreach ($cat['children'] as $subcat) { // Only show sub-categories that returned search results if ($subcat['total'] > 0) { // If we have a specific category, prepend it to the search term $blob = $subcat['name'] ? $subcat['name'] : ''; // Is this the active category? $a = ''; if ($subcat['name'] == $this->active) { $a = ' class="active"'; $name = $subcat['title']; $total = $subcat['total']; Pathway::append($subcat['title'], $here . '&area=' . stripslashes($blob)); } // Build the HTML $k[] = "\t\t\t" . '<li><a' . $a . ' href="' . Route::url($here . '&area=' . stripslashes($blob)) . '">' . $this->escape(stripslashes($subcat['title'])) . ' <span class="item-count">' . $subcat['total'] . '</span></a></li>'; } } // Do we actually have any links? // NOTE: this method prevents returning empty list tags "<ul></ul>" if (count($k) > 0) { $l .= "\t\t" . '<ul>' . "\n"; $l .= implode("\n", $k); $l .= "\t\t" . '</ul>' . "\n"; } } $l .= '</li>'; $links[] = $l;
/** * Method to set the document path * * @param array $course_pages List of roup pages * @return void */ public function _buildPathway($product) { if (Pathway::count() <= 0) { Pathway::append(Lang::txt(strtoupper($this->_option)), 'index.php?option=' . $this->_option); } if ($this->_task) { Pathway::append(Lang::txt($product)); } }
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @author Shawn Rice <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SPECIAL_NEW_PAGES'), $this->page->link()); $sort = strtolower(Request::getVar('sort', 'created')); if (!in_array($sort, array('created', 'title', 'summary', 'created_by'))) { $sort = 'created'; } $dir = strtoupper(Request::getVar('dir', 'DESC')); if (!in_array($dir, array('ASC', 'DESC'))) { $dir = 'DESC'; } $limit = Request::getInt('limit', Config::get('list_limit')); $start = Request::getInt('limitstart', 0); $database = App::get('db'); $query = "SELECT COUNT(*)\n\t\t\tFROM #__wiki_version AS wv\n\t\t\tINNER JOIN #__wiki_page AS wp\n\t\t\t\tON wp.id = wv.pageid\n\t\t\tWHERE wv.approved = 1\n\t\t\t\t" . ($this->page->get('scope') ? "AND wp.scope LIKE " . $database->quote($this->page->get('scope') . '%') . " " : "AND (wp.scope='' OR wp.scope IS NULL) ") . "\n\t\t\t\tAND wp.access != 2\n\t\t\t\tAND wp.state < 2\n\t\t\t\tAND wv.id = (SELECT MIN(wv2.id) FROM #__wiki_version AS wv2 WHERE wv2.pageid = wv.pageid)"; $database->setQuery($query); $total = $database->loadResult(); $query = "SELECT wv.pageid, wp.title, wp.pagename, wp.scope, wp.group_cn, wp.access, wv.version, wv.created_by, wv.created, wv.summary\n\t\t\tFROM #__wiki_version AS wv\n\t\t\tINNER JOIN #__wiki_page AS wp\n\t\t\t\tON wp.id = wv.pageid\n\t\t\tWHERE wv.approved = 1\n\t\t\t\t" . ($this->page->get('scope') ? "AND wp.scope LIKE " . $database->quote($this->page->get('scope') . '%') . " " : "AND (wp.scope='' OR wp.scope IS NULL) ") . "\n\t\t\t\tAND wp.access != 2\n\t\t\t\tAND wp.state < 2\n\t\t\t\tAND wv.id = (SELECT MIN(wv2.id) FROM #__wiki_version AS wv2 WHERE wv2.pageid = wv.pageid)\n\t\t\tORDER BY {$sort} {$dir}";
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @author Shawn Rice <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SPECIAL_LONG_PAGES'), 'index.php?option=' . $this->option . '&scope=' . $this->page->get('scope') . '&pagename=Special:LongPages'); $database = App::get('db'); $limit = Request::getInt('limit', Config::get('list_limit')); $start = Request::getInt('limitstart', 0); $query = "SELECT COUNT(*)\n\t\t\tFROM #__wiki_version AS wv\n\t\t\tINNER JOIN #__wiki_page AS wp\n\t\t\t\tON wp.id = wv.pageid\n\t\t\tWHERE wv.approved = 1\n\t\t\t\t" . ($this->page->get('scope') ? "AND wp.scope LIKE " . $database->quote($this->page->get('scope') . '%') . " " : "AND (wp.scope='' OR wp.scope IS NULL) ") . "\n\t\t\t\tAND wp.state < 2\n\t\t\t\tAND wp.access != 2\n\t\t\t\tAND wv.id = (SELECT MIN(wv2.id) FROM #__wiki_version AS wv2 WHERE wv2.pageid = wv.pageid)"; $database->setQuery($query); $total = $database->loadResult(); $query = "SELECT wv.pageid, wp.title, wv.length, wp.pagename, wp.scope, wp.group_cn, wp.access, wv.version, wv.created_by, wv.created\n\t\t\tFROM #__wiki_version AS wv\n\t\t\tINNER JOIN #__wiki_page AS wp\n\t\t\t\tON wp.id = wv.pageid\n\t\t\tWHERE wv.approved = 1\n\t\t\t\t" . ($this->page->get('scope') ? "AND wp.scope LIKE " . $database->quote($this->page->get('scope') . '%') . " " : "AND (wp.scope='' OR wp.scope IS NULL) ") . "\n\t\t\t\tAND wp.state < 2\n\t\t\t\tAND wp.access != 2\n\t\t\t\tAND wv.id = (SELECT MIN(wv2.id) FROM #__wiki_version AS wv2 WHERE wv2.pageid = wv.pageid)\n\t\t\tORDER BY length DESC"; if ($limit && $limit != 'all') { $query .= " LIMIT {$start}, {$limit}"; } $database->setQuery($query); $rows = $database->loadObjectList(); $pageNav = $this->pagination($total, $start, $limit); ?> <form method="get" action="<?php
* THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access defined('_HZEXEC_') or die; if (Pathway::count() <= 0) { Pathway::append(Lang::txt('COM_BLOG'), 'index.php?option=' . $this->option); } Pathway::append($this->row->published('Y'), 'index.php?option=' . $this->option . '&year=' . $this->row->published('Y')); Pathway::append($this->row->published('m'), 'index.php?option=' . $this->option . '&year=' . $this->row->published('Y') . '&month=' . sprintf("%02d", $this->row->published('m'))); Pathway::append(stripslashes($this->row->get('title')), $this->row->link()); Document::setTitle(Lang::txt('COM_BLOG') . ': ' . stripslashes($this->row->get('title'))); $this->css()->js(); $first = $this->archive->entries(array('state' => $this->filters['state'], 'authorized' => $this->filters['authorized']))->order('publish_up', 'asc')->limit(1)->row(); ?> <header id="content-header"> <h2><?php echo Lang::txt('COM_BLOG'); ?> </h2> <div id="content-header-extra"> <p> <a class="icon-archive archive btn" href="<?php echo Route::url('index.php?option=' . $this->option . '&task=archive'); ?>
function pathway($dd) { $db_id = $dd['db_id']; Document::setTitle($dd['title']); if (isset($db_id['extra']) && $db_id['extra'] == 'table') { $ref_title = "Datastore"; Pathway::append($ref_title, '/datastores/' . $db_id['name'] . '#tables'); } elseif (isset($_SERVER['HTTP_REFERER'])) { $ref_title = Request::getString('ref_title', $dd['title'] . " Resource"); $ref_title = htmlentities($ref_title); Pathway::append($ref_title, $_SERVER['HTTP_REFERER']); } Pathway::append($dd['title'], $_SERVER['REQUEST_URI']); }
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SEARCH'), $this->page->link('base') . '&pagename=Special:Search'); $database = App::get('db'); $limit = Request::getInt('limit', Config::get('list_limit')); $start = Request::getInt('limitstart', 0); $term = Request::getVar('q', ''); $filters = array('state' => array(0, 1)); if ($space = Request::getVar('namespace', '')) { $filters['namespace'] = urldecode($space); } $pages = \Components\Wiki\Models\Page::blank()->getTableName(); $versions = \Components\Wiki\Models\Version::blank()->getTableName(); $weight = '(match(' . $pages . '.title) against (' . $database->Quote($term) . ') + match(' . $versions . '.pagetext) against (' . $database->Quote($term) . '))'; $rows = $this->book->pages($filters)->select($pages . '.*')->select($versions . '.created_by')->select($versions . '.summary')->select($weight, 'weight')->join($versions, $versions . '.id', $pages . '.version_id')->whereRaw($weight . ' > 0')->order('weight', 'desc')->paginated()->rows(); ?> <form action="<?php echo Route::url($this->page->link('base') . '&pagename=Special:Search');
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * HUBzero is a registered trademark of Purdue University. * * @package hubzero-cms * @author Shawn Rice <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; Pathway::append(Lang::txt('COM_WIKI_SPECIAL_FILE_LIST'), $this->page->link()); $database = App::get('db'); $sort = strtolower(Request::getVar('sort', 'created')); if (!in_array($sort, array('created', 'filename', 'description', 'created_by'))) { $sort = 'created'; } $dir = strtoupper(Request::getVar('dir', 'DESC')); if (!in_array($dir, array('ASC', 'DESC'))) { $dir = 'DESC'; } $pages = \Components\Wiki\Models\Page::blank()->getTableName(); $attach = \Components\Wiki\Models\Attachment::blank()->getTableName(); $rows = \Components\Wiki\Models\Attachment::all()->select($attach . '.*')->select($pages . '.pagename')->select($pages . '.path')->select($pages . '.scope')->select($pages . '.scope_id')->join($pages, $pages . '.id', $attach . '.page_id')->whereEquals($pages . '.scope', $this->book->get('scope'))->whereEquals($pages . '.scope_id', $this->book->get('scope_id'))->paginated()->rows(); $altdir = $dir == 'ASC' ? 'DESC' : 'ASC'; ?> <form method="get" action="<?php