Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions application/controllers/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function login($redirect_url = '')
}

$this->data['title'] = "Login";
$this->data['page_title'] = $this->data['title'];

//validate form input
$this->form_validation->set_rules('identity', 'Identity', 'required');
Expand Down Expand Up @@ -116,6 +117,7 @@ function login($redirect_url = '')
$this->data['redirect_url'] = $redirect_url;

//$this->load->view('auth/login', $this->data);
$this->template->write_view('head', 'common/workflow_head.php', $this->data);
$this->template->write_view('content_left', build_view_path(__METHOD__), $this->data);
$this->template->render();
}
Expand Down
14 changes: 11 additions & 3 deletions application/controllers/admin/Author_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public function __construct()

public function index($route = 'unconfirmed', $id = 0)
{
$this->load->helper('previewer_helper');
$this->data['page_title'] = 'Author Manager';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);
$this->data['author_blurb_modal'] = $this->load->view('admin/author_manager/author_blurb_modal', $this->data, TRUE);
$this->data['author_projects_modal'] = $this->load->view('admin/author_manager/author_projects_modal', $this->data, TRUE);
Expand All @@ -28,17 +30,21 @@ public function index($route = 'unconfirmed', $id = 0)
{
// Default: view unconfirmed authors
$this->data['authors'] = $this->author_model->order_by('id', 'asc')->get_many_by(array('linked_to' => '0', 'confirmed' => '0'));
$this->data['page_title'] = 'Unconfirmed Authors | '. $this->data['page_title'];
}
elseif ($route == 'id')
{
// Individual: view author by ID
$this->data['authors'] = array($this->author_model->get($id));
$author = $this->data['authors'][0];
if ($author) $this->data['page_title'] = format_author_name($author) .' | '. $this->data['page_title'];
}
elseif ($route == 'all')
{
// Old way: view all non-duplicate authors (very slow!)
ini_set('memory_limit', '-1'); // Still a hack
$this->data['authors'] = $this->author_model->order_by('id', 'asc')->get_many_by(array('linked_to' => '0'));
$this->data['page_title'] = 'All Authors | '. $this->data['page_title'];
}
elseif ($route == 'project')
{
Expand All @@ -47,11 +53,14 @@ public function index($route = 'unconfirmed', $id = 0)
$results_to_cast = array();
$this->load->model('project_model');

$project = $this->project_model->get($id);
if ($project) $this->data['page_title'] = create_full_title($project) .' | '. $this->data['page_title'];

$project_authors = $this->project_model->get_authors_by_project($id, 'author', include_sections: true);
if ($project_authors) $results_to_cast = array_merge($results_to_cast, $project_authors);

$project_translators = $this->project_model->get_authors_by_project($id, 'translator');
if ($project_translators) $results_to_cast = array_merge($results_to_cast, $project_translators);
if ($project_translators) $results_to_cast = array_merge($results_to_cast, $project_translators);
Comment on lines -54 to +63

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

White-space fix! Nothing to see here. 😉


// Hack: get_authors_by_project returns an array of *arrays*.
// We need to cast them as objects, to match types with the db->get*() results
Expand All @@ -63,8 +72,7 @@ public function index($route = 'unconfirmed', $id = 0)
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function update_author_value()
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/Genre_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function __construct()

public function index()
{
$this->data['page_title'] = 'Genre Manager';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['genres'] = $this->mahana_hierarchy->get_sorted_children();
Expand All @@ -30,8 +31,7 @@ public function index()

$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function update_genre()
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/Language_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ public function index()
{
ini_set('memory_limit', '-1'); //we need to see about chunking this

$this->data['page_title'] = 'Language Manager';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['languages'] = $this->language_model->order_by('common', 'desc')->order_by('language', 'asc')->get_all(); //

$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function update_language_value()
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/catalog/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function index($author_id)
$matches = $this->_get_all_author($author_id);
$this->data['matches'] = count($matches);

$this->data['page_title'] = 'Works by '. format_author($this->data['author']);

$this->data['search_order'] = $this->input->get('search_order');

$this->_render('catalog/author');
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/catalog/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public function index($group_id)
$matches = $this->_get_all_group_projects($group_id, 0, 1000000);
$this->data['matches'] = count($matches);

$this->data['page_title'] = 'Works in "' . $this->data['group']->name . '"';

$this->data['search_order'] = $this->input->get('search_order');

$this->_render('catalog/group');
Expand Down
1 change: 1 addition & 0 deletions application/controllers/catalog/Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function index($keywords_id)
$params['search_order'] = $this->input->get('search_order');
$matches = $this->_get_projects_by_keywords_id($params);
$this->data['matches'] = count($matches);
$this->data['page_title'] = 'Works tagged with "' . $this->data['keywords']->value . '"';
$this->_render('catalog/keywords');
return;
}
Expand Down
4 changes: 4 additions & 0 deletions application/controllers/catalog/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public function index($slug)
//create link to project editing page for logged in user with appropriate permissions
$this->data['project']->edit_link = $this->_get_edit_link($this->data['project']->id);

// **** TITLE ****//
// Used for HTML page title, and also views/catalog/page.php
$this->data['page_title'] = create_full_title($this->data['project']);

// **** AUTHORS ****//
$this->data['authors_string'] = '';

Expand Down
2 changes: 2 additions & 0 deletions application/controllers/catalog/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public function index($reader_id)
$matches = $this->_get_all_reader($reader_id);
$this->data['matches'] = count($matches);

$this->data['page_title'] = 'Works read by '. $this->data['reader']['display_name'];

$this->data['search_order'] = $this->input->get('search_order');

$this->_render('catalog/reader');
Expand Down
2 changes: 2 additions & 0 deletions application/controllers/catalog/Sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public function readers($user_id = 0)
$matches = $this->_get_all_reader($user_id);
$this->data['matches'] = count($matches);

$this->data['page_title'] = 'Section details for ' . $this->data['reader']->display_name;

$this->_render('catalog/sections');
return;
}
Expand Down
12 changes: 8 additions & 4 deletions application/controllers/private/Administer_projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ public function index()
{
$prototype['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $prototype);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $prototype);
}

public function add_catalog_item($project_id = 0)
{
//We might be new here, we might be looking up the project launch data, or we might be submitting our new data
// Set titles that match the link we took to this page:
$this->data['page_title'] = 'Project Screen';
if ($project_id == 'new') $this->data['page_title'] = 'Add New Project | '. $this->data['page_title'];
elseif ($project_id == 'search') $this->data['page_title'] = 'Search Projects | '. $this->data['page_title'];

$prototype = $this->catalog_item->get_prototype();

Expand All @@ -61,6 +64,8 @@ public function add_catalog_item($project_id = 0)
$this->load->model('project_model');
$project = $this->project_model->get($project_id);

if ($project) $this->data['page_title'] = create_full_title($project) .' | '. $this->data['page_title'];

$volunteers = array('bc', 'altbc', 'mc', 'pl');

foreach ($volunteers as $key => $type)
Expand Down Expand Up @@ -114,8 +119,7 @@ public function add_catalog_item($project_id = 0)
$this->template->add_css('css/private/administer_projects/new_project_form.css');
$this->template->add_js('js/private/administer_projects/new_project_form.js');

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $prototype);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $prototype);
}

public function ajax_lookup_project_code()
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/private/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Groups extends Private_Controller

public function index()
{
$this->data['page_title'] = 'Group Manager';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->load->model('group_model');
Expand All @@ -18,8 +19,7 @@ public function index()

$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function update_group()
Expand Down
4 changes: 2 additions & 2 deletions application/controllers/private/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function index($user_projects = false)

$this->data['project_search'] = empty($params['project_search']) ? '' : $params['project_search'];

$this->data['page_title'] = 'Projects';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

//load volunteers AFTER the menu_header
Expand Down Expand Up @@ -61,8 +62,7 @@ public function index($user_projects = false)
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function ajax_search_catalog()
Expand Down
9 changes: 5 additions & 4 deletions application/controllers/private/Section_compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public function index($project_id = 0)
$this->load->model('project_model');
$this->data['project'] = $this->project_model->get($project_id);

$this->data['page_title'] = create_full_title($this->data['project']) .' | Section Compiler';

$this->data['admin_mc'] = 0;

$allowed_groups = array(PERMISSIONS_ADMIN, PERMISSIONS_MCS);
Expand Down Expand Up @@ -73,12 +75,12 @@ public function index($project_id = 0)

$this->template->add_js('js/common/autocomplete.js');

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function select_project()
{
$this->data['page_title'] = 'Search Projects | Section Compiler';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['statuses'] = $this->config->item('project_statuses');
Expand All @@ -90,8 +92,7 @@ public function select_project()
$this->template->add_css('css/private/administer_projects/new_project_form.css'); //reuse results styling
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function order_sections()
Expand Down
28 changes: 14 additions & 14 deletions application/controllers/private/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public function index($user_id = 0)
{
$user_id = ($user_id) ? $user_id : $this->librivox_auth->get_user_id();

$this->data['page_title'] = 'Stats';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->load->model('project_model');

$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function mc_stats()
Expand All @@ -39,20 +39,21 @@ public function mc_stats()
}

//https://catalog.librivox.org/MCstats.php
$this->data['page_title'] = 'MC Stats';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['volunteers'] = $this->stats_model->mc_stats();

$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function monthly_stats()
{
//https://catalog.librivox.org/monthly.php
$this->data['page_title'] = 'Monthly Stats';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['monthly_stats'] = $this->stats_model->monthly_stats();
Expand All @@ -61,13 +62,13 @@ public function monthly_stats()
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function general_stats()
{
//https://catalog.librivox.org/stats.php -- general stats page
$this->data['page_title'] = 'General Stats';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

//$this->data['stats'] = $this->stats_model->monthly_stats();
Expand All @@ -83,29 +84,29 @@ public function general_stats()
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function chapters_count($user_id = 0)
{
$user_id = ($user_id) ? $user_id : $this->librivox_auth->get_user_id();

//https://catalog.librivox.org/chapters_count.php
$this->data['page_title'] = 'Chapters Count';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

public function sections($user_id = 0)
{
$user_id = ($user_id) ? $user_id : $this->librivox_auth->get_user_id();

//https://catalog.librivox.org/chapters_count.php
$this->data['page_title'] = 'Sections';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->load->model('section_model');
Expand Down Expand Up @@ -164,8 +165,7 @@ public function sections($user_id = 0)
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

//updates stats
Expand All @@ -191,6 +191,7 @@ public function active_projects()
redirect(base_url() . '/auth/error_no_permission');
}

$this->data['page_title'] = 'Active Projects';
$this->data['menu_header'] = $this->load->view('private/common/menu_header', $this->data, TRUE);

$this->data['projects'] = $this->stats_model->active_projects();
Expand Down Expand Up @@ -224,8 +225,7 @@ public function active_projects()
$this->insertMethodCSS();
$this->insertMethodJS();

$this->template->write_view('content_left', $this->base_path . '/' . build_view_path(__METHOD__), $this->data);
$this->template->render();
$this->_render($this->base_path . '/' . build_view_path(__METHOD__), $this->data);
}

}
Expand Down
Loading