Skip to content

Commit

Permalink
Issue #111: ThinkTankController->setPageTitle method is a wrapper for…
Browse files Browse the repository at this point in the history
… addToView('controller_title', )
  • Loading branch information
ginatrapani committed Jul 17, 2010
1 parent 0ddca24 commit 9ca5d27
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion webapp/controller/class.AccountConfigurationController.php
Expand Up @@ -16,7 +16,7 @@ public function __construct($session_started=false) {
parent::__construct($session_started);
$this->disableCaching();
$this->setViewTemplate('account.index.tpl');
$this->addToView('controller_title', 'Configure Your Account');
$this->setPageTitle('Configure Your Account');
}

public function authControl() {
Expand Down
2 changes: 1 addition & 1 deletion webapp/controller/class.InlineViewController.php
Expand Up @@ -27,7 +27,7 @@ class InlineViewController extends ThinkTankAuthController {
*/
public function __construct($session_started=false) {
parent::__construct($session_started);
$this->addToView('controller_title', 'Inline View');
$this->setPageTitle('Inline View');
foreach ($this->REQUIRED_PARAMS as $param) {
if (!isset($_GET[$param]) || $_GET[$param] == '' ) {
$this->addInfoMessage('No user to retrieve.');
Expand Down
2 changes: 1 addition & 1 deletion webapp/controller/class.LoginController.php
Expand Up @@ -10,7 +10,7 @@ class LoginController extends ThinkTankController {

public function __construct($session_started=false) {
parent::__construct($session_started);
$this->addToView('controller_title', 'Log in');
$this->setPageTitle('Log in');
$this->setViewTemplate('session.login.tpl');
$this->disableCaching();
}
Expand Down
2 changes: 1 addition & 1 deletion webapp/controller/class.PostController.php
Expand Up @@ -20,7 +20,7 @@ class PostController extends ThinkTankAuthController {
public function __construct($session_started=false) {
parent::__construct($session_started);
$this->post_dao = DAOFactory::getDAO('PostDAO');
$this->addToView('controller_title', 'Post details');
$this->setPageTitle('Post details');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion webapp/controller/class.PrivateDashboardController.php
Expand Up @@ -24,7 +24,7 @@ public function __construct($session_started=false) {
if (isset($last_updated_instance)) {
$this->addToView('crawler_last_run', $last_updated_instance->crawler_last_run);
}
$this->addToView('controller_title', 'Private Dashboard');
$this->setPageTitle('Private Dashboard');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions webapp/controller/class.PublicTimelineController.php
Expand Up @@ -33,7 +33,7 @@ public function __construct($session_started=false) {
if (isset($last_updated_instance)) {
$this->addToView('crawler_last_run', $last_updated_instance->crawler_last_run);
}
$this->addToView('controller_title', 'Public Timeline');
$this->setPageTitle('Public Timeline');
}

/**
Expand Down Expand Up @@ -95,7 +95,7 @@ private function loadPublicInstanceDashboard($username, $network) {
$instance = $instance_dao->getByUsernameOnNetwork($username, $network);

if (isset($instance) && $instance->is_public) {
$this->addToView('controller_title', $instance->network_username . "'s Public Profile");
$this->setPageTitle($instance->network_username . "'s Public Profile");

$this->addToView('instance', $instance);
//user
Expand Down
9 changes: 9 additions & 0 deletions webapp/controller/class.ThinkTankController.php
Expand Up @@ -224,6 +224,15 @@ protected function shouldRefreshCache() {
}
}

/**
* Set web page title
* This method only works for views that reference _header.tpl.
* @param str $title
*/
public function setPageTitle($title) {
$this->addToView('controller_title', $title);
}

/**
* Add error message to view
* @param str $msg
Expand Down

0 comments on commit 9ca5d27

Please sign in to comment.