/** * Returns a list of buttons for the frontend * * @return array */ public static function getSiteButtons() { $user = JFactory::getUser(); $buttons = array(); if ($user->authorise('core.create', 'com_pfprojects')) { $buttons[] = array('title' => 'MOD_PF_DASH_BUTTONS_ADD_PROJECT', 'link' => PFprojectsHelperRoute::getProjectsRoute() . '&task=form.add', 'icon' => JHtml::image('com_projectfork/projectfork/header/icon-48-projectform.add.png', JText::_('MOD_PF_DASH_BUTTONS_ADD_PROJECT'), null, true)); } return $buttons; }
<?php if ($this->params->get('show_page_heading', 1)) { ?> <h1><?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php } ?> <div class="clearfix"></div> <div class="grid"> <form name="adminForm" id="adminForm" action="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectsRoute()); ?> " method="post"> <div class="btn-toolbar btn-toolbar-top"> <?php echo $this->toolbar; ?> <a class="btn button" id="print_btn" href="javascript:void(0);" onclick="window.open('<?php echo JRoute::_($print_url); ?> ', 'print', '<?php echo $print_opt; ?> ')"> <?php
/** * Generates the toolbar for the top of the view * * @return string Toolbar with buttons */ protected function getToolbar() { $id = empty($this->item) || empty($this->item->id) ? null : $this->item->id; $access = PFprojectsHelper::getActions($id); $uid = JFactory::getUser()->get('id'); if (!empty($id)) { $slug = $this->item->id . ':' . $this->item->alias; $return = base64_encode(PFprojectsHelperRoute::getDashboardRoute($slug)); PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFprojectsHelperRoute::getProjectsRoute() . '&task=form.edit&id=' . $slug . '&return=' . $return))); } return PFToolbar::render(); }
/** * Method to generate the frontend input markup. * * @param string $title The title of the current value * * @return array $html The html field markup */ protected function getSiteHTML($title) { $html = array(); $isJ3 = version_compare(JVERSION, '3.0.0', 'ge'); if (JFactory::getApplication()->isSite()) { $link = PFprojectsHelperRoute::getProjectsRoute() . '&layout=modal&tmpl=component' . '&function=pfSelectProject_' . $this->id; } else { $link = 'index.php?option=com_pfprojects&view=projects' . '&layout=modal&tmpl=component' . '&function=pfSelectProject_' . $this->id; } // Initialize some field attributes. $attr = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; if ($isJ3) { $html[] = '<div class="input-append">'; } // Create a dummy text field with the project title. $html[] = '<input type="text" id="' . $this->id . '_name" value="' . htmlspecialchars($title, ENT_COMPAT, 'UTF-8') . '" disabled="disabled"' . $attr . ' />'; // Create the project select button. if ($this->element['readonly'] != 'true') { $html[] = '<a class="modal_' . $this->id . ' btn" title="' . JText::_('COM_PROJECTFORK_SELECT_PROJECT') . '"' . ' href="' . JRoute::_($link) . '" rel="{handler: \'iframe\', size: {x: 800, y: 500}}">'; $html[] = JText::_('COM_PROJECTFORK_SELECT_PROJECT') . '</a>'; } if ($isJ3) { $html[] = '</div>'; } // Create the hidden field, that stores the id. $html[] = '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />'; return $html; }
// Find the project repo base dir if ($pid) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('attribs')->from('#__pf_projects')->where('id = ' . $db->quote($pid)); $db->setQuery($query); $project_attribs = $db->loadResult(); $project_params = new JRegistry(); $project_params->loadString($project_attribs); $repo_dir = (int) $project_params->get('repo_dir'); } else { $repo_dir = 1; } // Prepare component base links $link_tasks = class_exists('PFtasksHelperRoute') ? PFtasksHelperRoute::getTasksRoute() : 'index.php?option=com_pftasks'; $link_projects = class_exists('PFprojectsHelperRoute') ? PFprojectsHelperRoute::getProjectsRoute() : 'index.php?option=com_pfprojects'; $link_time = class_exists('PFtimeHelperRoute') ? PFtimeHelperRoute::getTimesheetRoute() : 'index.php?option=com_pftime'; $link_ms = class_exists('PFmilestonesHelperRoute') ? PFmilestonesHelperRoute::getMilestonesRoute() : 'index.php?option=com_pfmilestones'; $link_forum = class_exists('PFforumHelperRoute') ? PFforumHelperRoute::getTopicsRoute() : 'index.php?option=com_pfforum'; $link_repo = class_exists('PFrepoHelperRoute') ? PFrepoHelperRoute::getRepositoryRoute($pid, $repo_dir) : 'index.php?option=com_pfrepo&filter_project=' . $pid . '&parent_id=' . $repo_dir; // Logout link return $return = base64_encode($this->baseurl); ?> <!DOCTYPE html> <html> <head> <jdoc:include type="head" /> <?php // Detecting Home $site_app = JFactory::getApplication('Site'); $menu = $site_app->getMenu();
$list_dir = $this->escape($this->state->get('list.direction')); $user = JFactory::getUser(); $app = JFactory::getApplication(); $nulldate = JFactory::getDbo()->getNullDate(); $uid = $user->get('id'); $itemid = PFApplicationHelper::getActiveMenuItemId(); $filter_in = $this->state->get('filter.isset') ? 'in ' : ''; $milestones_enabled = PFApplicationHelper::enabled('com_pfmilestones'); $tasks_enabled = PFApplicationHelper::enabled('com_pftasks'); $time_enabled = PFApplicationHelper::enabled('com_pftime'); $repo_enabled = PFApplicationHelper::enabled('com_pfrepo'); $forum_enabled = PFApplicationHelper::enabled('com_pfforum'); $users_enabled = PFApplicationHelper::enabled('com_pfusers'); $cmnts_enabled = PFApplicationHelper::enabled('com_pfcomments'); $is_ssl = JFactory::getURI()->isSSL(); $list_url = PFprojectsHelperRoute::getProjectsRoute($this->params->get('filter_category'), $itemid); $return_url = base64_encode($list_url); $print_url = $list_url . '&tmpl=component&layout=print'; $print_opt = 'width=1024,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no'; ?> <div id="projectfork" class="category-list<?php echo $this->pageclass_sfx; ?> view-projects PrintArea all"> <?php if ($this->params->get('show_page_heading', 1)) { ?> <h1><?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
/** * Get the return URL. * If a "return" variable has been passed in the request * * @return string The return URL. */ protected function getReturnPage() { $return = JRequest::getVar('return', null, 'default', 'base64'); if (empty($return) || !JUri::isInternal(base64_decode($return))) { return JRoute::_(PFprojectsHelperRoute::getProjectsRoute(), false); } else { return base64_decode($return); } }
<?php if ($this->params->get('show_page_heading', 1)) { ?> <h1><?php echo $this->escape($this->params->get('page_heading')); ?> </h1> <?php } ?> <div class="clearfix"></div> <div class="grid"> <form name="adminForm" id="adminForm" action="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectsRoute($this->params->get('filter_category'), $itemid)); ?> " method="post"> <div class="btn-toolbar btn-toolbar-top"> <?php echo $this->toolbar; ?> <a class="btn button" id="print_btn" href="javascript:void(0);" onclick="window.open('<?php echo JRoute::_($print_url); ?> ', 'print', '<?php echo $print_opt; ?> ')"> <?php echo JText::_('COM_PROJECTFORK_PRINT');
defined('_JEXEC') or die; $function = JRequest::getCmd('function', 'pfSelectActiveProject'); $list_order = $this->escape($this->state->get('list.ordering')); $list_dir = $this->escape($this->state->get('list.direction')); $user = JFactory::getUser(); $uid = $user->get('id'); ?> <div id="projectfork" class="category-list<?php echo $this->pageclass_sfx; ?> view-projects"> <div class="cat-items"> <form name="adminForm" id="adminForm" action="<?php echo JRoute::_(PFprojectsHelperRoute::getProjectsRoute() . '&layout=modal&tmpl=component&function=' . $function); ?> " method="post"> <fieldset class="filters"> <span class="filter-search"> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?> " /> <button type="submit" class="btn"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?> </button> <button type="button" class="btn" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR');