Improving using of twig instead of loading in PHP

skala
Julio Montoya 13 years ago
parent b344c60cd5
commit fec1c8636d
  1. 10
      main/messages/inbox.php
  2. 10
      main/messages/new_message.php
  3. 10
      main/messages/outbox.php
  4. 12
      main/messages/view_message.php
  5. 7
      main/social/friends.php
  6. 6
      main/social/group_add.php
  7. 6
      main/social/group_edit.php
  8. 6
      main/social/group_invitation.php
  9. 8
      main/social/group_members.php
  10. 5
      main/social/group_topics.php
  11. 6
      main/social/group_waiting_list.php
  12. 8
      main/social/groups.php
  13. 10
      main/social/home.php
  14. 6
      main/social/invitations.php
  15. 6
      main/social/myfiles.php
  16. 6
      main/social/profile.php
  17. 12
      main/social/search.php
  18. 1
      main/social/skills_ranking.php

@ -169,11 +169,11 @@ if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
} else { } else {
$content = $social_right_content; $content = $social_right_content;
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} }
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -358,11 +358,11 @@ if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
} else { } else {
$content = $social_right_content; $content = $social_right_content;
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} }
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -156,11 +156,11 @@ if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
} else { } else {
$content = $social_right_content; $content = $social_right_content;
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
} }
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -82,12 +82,12 @@ if (api_get_setting('allow_social_tool') == 'true') {
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
} else { } else {
$content = $social_right_content; $content = $social_right_content;
}
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();
}

@ -142,11 +142,8 @@ $social_right_content .= '</div>';
$tpl = new Template(get_lang('Social')); $tpl = new Template(get_lang('Social'));
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $message); $tpl->assign('message', $message);
$tpl->assign('content', $content); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display_one_col_template(); $tpl->display($social_layout);

@ -117,9 +117,7 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display_one_col_template(); $tpl->display($social_layout);

@ -150,9 +150,9 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -538,9 +538,9 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -124,16 +124,14 @@ if (count($new_member_list) > 0) {
} }
$social_right_content .= '</div>'; $social_right_content .= '</div>';
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->set_help('Groups'); $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -195,9 +195,8 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -107,9 +107,9 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -33,7 +33,7 @@ if (isset($_GET['anchor_topic'])) {
} }
$anchor = 'topic_'.$match[1]; $anchor = 'topic_'.$match[1];
} }
$htmlHeadXtra[] = '<script type="text/javascript"> $htmlHeadXtra[] = '<script>
var counter_image = 1; var counter_image = 1;
function remove_image_form(id_elem1) { function remove_image_form(id_elem1) {
@ -531,9 +531,9 @@ $tpl->set_help('Groups');
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -60,8 +60,7 @@ $user_info = UserManager :: get_user_info_by_id(api_get_user_id());
$social_left_content = SocialManager::show_social_menu('home'); $social_left_content = SocialManager::show_social_menu('home');
$social_right_content .= '<div class="span5">'; $social_right_content = '<div class="span5">';
$social_right_content .= '<div class="well_border">'; $social_right_content .= '<div class="well_border">';
$social_right_content .= '<h3>'.get_lang('ContactInformation').'</h3>'; $social_right_content .= '<h3>'.get_lang('ContactInformation').'</h3>';
@ -165,11 +164,6 @@ $social_right_content .= '</div>';
$tpl = new Template(get_lang('SocialNetwork')); $tpl = new Template(get_lang('SocialNetwork'));
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -192,9 +192,9 @@ $tpl = new Template($tool_name);
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -105,9 +105,9 @@ $tpl = new Template();
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $show_message); $tpl->assign('message', $show_message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -681,9 +681,9 @@ $tpl = new Template(get_lang('Social'));
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu); $tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout);
$tpl->assign('actions', $actions); $tpl->assign('actions', $actions);
$tpl->assign('message', $message); $tpl->assign('message', $message);
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$tpl->display($social_layout);

@ -152,16 +152,14 @@ if ($query !='') {
} }
$visibility = array(true,true,true,true,true); $visibility = array(true,true,true,true,true);
$social_right_content .= Display::return_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility); $social_right_content .= Display::return_sortable_grid('mygroups', array(), $grid_groups, array('hide_navigation'=>true, 'per_page' => 5), $query_vars, false, $visibility);
} }
$tpl = new Template($tool_name); $tpl = new Template($tool_name);
$tpl->assign('social_left_content', $social_left_content); $tpl->assign('social_left_content', $social_left_content);
$tpl->assign('social_left_menu', $social_left_menu);
$tpl->assign('social_right_content', $social_right_content); $tpl->assign('social_right_content', $social_right_content);
$social_layout = $tpl->get_template('layout/social_layout.tpl'); $social_layout = $tpl->get_template('layout/social_layout.tpl');
$content = $tpl->fetch($social_layout); $tpl->display($social_layout);
$tpl->assign('actions', $actions);
$tpl->assign('message', $show_message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();

@ -61,4 +61,3 @@ $content .= $tpl->fetch('default/skill/skill_ranking.tpl');
$tpl->assign('content', $content); $tpl->assign('content', $content);
$tpl->display_one_col_template(); $tpl->display_one_col_template();

Loading…
Cancel
Save