예제 #1
0
 /**
  * List the contributions for the category and its children
  *
  * @param array $categories The id's of the categories from which to select.
  * @param string $sort_url The base url from which to sort.
  *
  * @return \phpbb\titania\sort
  */
 protected function list_contributions($categories, $sort_url)
 {
     $mode = $this->id ? 'category' : 'all';
     $sort = \contribs_overlord::build_sort();
     $sort->set_defaults(25);
     $branch = (int) str_replace('.', '', $this->branch);
     $data = \contribs_overlord::display_contribs($mode, $categories, $branch, $sort);
     // Canonical URL
     $data['sort']->set_url($sort_url);
     $this->template->assign_var('U_CANONICAL', $data['sort']->build_canonical());
     return $data['sort'];
 }
예제 #2
0
<?php

/**
 *
 * @package titania
 * @version $Id$
 * @copyright (c) 2008 phpBB Customisation Database Team
 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
 *
 */
/**
* @ignore
*/
if (!defined('IN_TITANIA')) {
    exit;
}
// Setup the sort tool to sort by contribution name ascending
$sort = contribs_overlord::build_sort();
$sort->set_url(titania::$author->get_url('contributions'));
$sort->set_defaults(false, 'c', 'a');
contribs_overlord::display_contribs('author', titania::$author->user_id, $sort);
phpbb::$template->assign_vars(array('S_AUTHOR_LIST' => true, 'U_CANONICAL' => $sort->build_canonical()));
titania::page_header(titania::$author->get_username_string('username') . ' - ' . phpbb::$user->lang['AUTHOR_CONTRIBS']);
titania::page_footer(true, 'authors/author_contributions.html');
예제 #3
0
 /**
  * Display author contributions page.
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 protected function contributions()
 {
     // Setup the sort tool to sort by contribution support status and name ascending
     $sort = \contribs_overlord::build_sort();
     $sort->set_url($this->author->get_url('contributions'));
     $sort->set_sort_keys(array('sc' => array('SORT_CONTRIB_NAME', 'c.contrib_limited_support, c.contrib_name', true)));
     $sort->set_defaults(24, 'sc', 'a');
     \contribs_overlord::display_contribs('author', $this->author->user_id, false, $sort);
     $this->template->assign_vars(array('S_AUTHOR_LIST' => true, 'U_CANONICAL' => $sort->build_canonical()));
     return $this->helper->render('authors/author_contributions.html', $this->get_title('AUTHOR_CONTRIBS'));
 }
예제 #4
0
            }
            // Include the current category in the ones selected
            $child_categories[] = $category_id;
            $data = contribs_overlord::display_contribs('category', $child_categories, $sort);
            // Canonical URL
            $data['sort']->set_url($category_object->get_url());
            phpbb::$template->assign_var('U_CANONICAL', $data['sort']->build_canonical());
        } else {
            // Mark all contribs read
            if (request_var('mark', '') == 'contribs') {
                titania_tracking::track(TITANIA_CONTRIB, 0);
            }
            phpbb::$template->assign_vars(array('CATEGORY_ID' => 0, 'U_MARK_FORUMS' => titania_url::append_url(titania_url::$current_page_url, array('mark' => 'contribs')), 'L_MARK_FORUMS_READ' => phpbb::$user->lang['MARK_CONTRIBS_READ'], 'S_DISPLAY_SEARCHBOX' => true, 'S_SEARCHBOX_ACTION' => titania_url::build_url('find-contribution')));
            // Setup the sort tool to only display the 10 most recent
            $sort = contribs_overlord::build_sort();
            $sort->set_defaults(10);
            $data = contribs_overlord::display_contribs('all', 0, $sort);
            // Canonical URL
            $data['sort']->set_url('');
            phpbb::$template->assign_var('U_CANONICAL', $data['sort']->build_canonical());
        }
        phpbb::$template->assign_vars(array('U_CREATE_CONTRIBUTION' => phpbb::$auth->acl_get('u_titania_contrib_submit') ? titania_url::build_url('author/' . htmlspecialchars_decode(phpbb::$user->data['username_clean']) . '/create') : '', 'S_HAS_CONTRIBS' => $categories_ary && $categories_ary[$category_id]['category_type'] ? true : false));
        if ($category_id != 0) {
            $category_name = isset(phpbb::$user->lang[$category_object->category_name]) ? phpbb::$user->lang[$category_object->category_name] : $category_object->category_name;
            titania::page_header($category_name . ' - ' . phpbb::$user->lang['CUSTOMISATION_DATABASE']);
            titania::page_footer(true, 'index_body.html');
        }
        break;
}
titania::page_header('CUSTOMISATION_DATABASE');
titania::page_footer(true, 'index_body.html');