Example #1
0
function pages_homepage()
{
    $page = new Template();
    $page->title = "Are you Happy?";
    $page->add_js('js/pages.index.js', 'pages');
    $page->load_template('templates/pages.home.tpl.php', 'pages');
    return $page->render();
}
 public function render($mode = 'teaser')
 {
     $vars = array();
     $vars['location_name'] = $this->name;
     switch ($mode) {
         case 'micro':
             return '<span class="location_name">' . $this->name . '</span>';
             break;
         case 'teaser':
         default:
             $template = new Template(false);
             $template->load_template('templates/location.teaser.tpl.php', 'location');
             $template->add_variable($vars);
     }
     return $template->render();
 }
Example #3
0
function mysql_errors($description)
{
    $tpl = new Template();
    $tpl->dir = ROOT_DIR . "/templates/";
    $tpl->load_template('mysql.tpl');
    $tpl->set('{THEME}', $templates);
    $tpl->set('{description}', charset_x_win($description));
    $tpl->compile('mysql_errors');
    eval(' ?' . '>' . $tpl->result['mysql_errors'] . '<' . '?php ');
    $tpl->global_clear();
}
Example #4
0
 public function render($mode = 'teaser')
 {
     $vars = array();
     $vars['user_picture'] = $this->picture->render('thumbnail');
     $vars['user_name'] = $this->display_name;
     $vars['user_location'] = $this->location->render('micro');
     switch ($mode) {
         case 'teaser':
         default:
             $template = new Template(false);
             $template->load_template('templates/user.teaser.tpl.php', 'user');
             $template->add_variable($vars);
             return $template->render();
     }
 }
Example #5
0
function user_edit_page($uid = false)
{
    $user = new User($uid, true, true);
    //no cache, current, with entities
    $page = new Template();
    $page->title = 'Edit Your Profile';
    $page->load_template('templates/user.edit.tpl.php', 'user');
    $page->add_js('js/location.widget.js', 'location');
    $vars = array();
    $vars['page_title'] = $page->title;
    $vars['form_pseudonym'] = template_form_item('pseudonym', 'Pseudonym (username)', 'text', $user->username, 'span12', array(), '');
    $vars['form_email'] = template_form_item('email', 'E-mail', 'text', $user->email, 'span12', array(), '');
    $vars['form_firstname'] = template_form_item('firstname', 'Firstname', 'text', $user->firstname, 'span12', array(), '');
    $vars['form_lastname'] = template_form_item('lastname', 'Lastname', 'text', $user->lastname, 'span12', array(), '');
    $vars['form_age'] = template_form_item('age', 'Age', 'text', $user->age, 'span12', array(), '');
    $vars['form_profile'] = template_form_item('profile', 'Profile', 'html', '', '', array('rows' => '11'));
    $vars['form_gender'] = template_form_item('gender', 'Gender', 'select', $user->gender, 'span12', array('male' => 'Male', 'female' => 'Female'), '');
    $vars['form_location'] = template_form_item('location', 'Location', 'location', $user->location, '', array());
    $vars['form_password'] = template_form_item('password', 'Password', 'password', '', 'span12', array(), '');
    $vars['form_cpassword'] = template_form_item('cpassword', 'Confirm', 'password', '', 'span12', array(), '');
    $vars['form_picture'] = template_form_item('picture', 'Picture', 'image', $user->picture, 'span12', array(), '');
    $vars['form_submit'] = template_form_item('user_register_submit', 'Submit', 'submit', '', 'span6 pull-right');
    $vars['form_action'] = get_url('/user/update/');
    $page->add_variable($vars);
    return $page->render();
}