1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 05:55:02 +03:00

Хуки в шаблонах + фиксы

This commit is contained in:
Mzhelskiy Maxim 2012-04-20 17:54:23 +04:00
parent c7fcbc713e
commit 01d9fc698a
26 changed files with 90 additions and 32 deletions

View file

@ -21,7 +21,7 @@
*/
class PluginPage_HookPage extends Hook {
public function RegisterHook() {
$this->AddHook('template_main_menu','Menu');
$this->AddHook('template_main_menu_item','Menu');
}
public function Menu() {

View file

@ -14,6 +14,8 @@
{hook run='admin_action_item'}
</ul>
{hook run='admin_action'}
{include file='footer.tpl'}

View file

@ -81,6 +81,7 @@
<footer class="blog-footer">
{hook run='blog_info_begin' oBlog=$oBlog}
<strong>{$aLang.blog_user_administrators} ({$iCountBlogAdministrators}):</strong>
<a href="{$oUserOwner->getUserWebPath()}" class="user"><i class="icon-user"></i>{$oUserOwner->getLogin()}</a>
{if $aBlogAdministrators}
@ -115,13 +116,14 @@
{else}
{$aLang.blog_user_readers_empty}
{/if}
{hook run='blog_info_end' oBlog=$oBlog}
</footer>
</div>
<a href="#" class="blog-more" id="blog-more" onclick="return ls.blog.toggleInfo()">{$aLang.blog_expand_info}</a>
</div>
{hook run='blog_info' oBlog=$oBlog}
<div class="nav-blog-wrapper">
<ul class="nav nav-pills nav-blog">

View file

@ -12,7 +12,9 @@
</script>
<h2 class="page-header">{$aLang.user_authorization}</h2>
{hook run='login_begin'}
<form action="{router page='login'}" method="POST" id="login-form">
{hook run='form_login_begin'}
@ -48,6 +50,6 @@
</form>
{/if}
{hook run='login_end'}
{include file='footer.tpl'}

View file

@ -1,3 +1,4 @@
{hook run='people_sidebar_begin'}
<section class="block">
<header class="block-header">
<h3>{$aLang.user_stats}</h3>
@ -23,4 +24,6 @@
{insert name="block" block='tagsCountry'}
{insert name="block" block='tagsCity'}
{insert name="block" block='tagsCity'}
{hook run='people_sidebar_end'}

View file

@ -1,4 +1,5 @@
<div class="profile">
{hook run='profile_top_begin' oUserProfile=$oUserProfile}
<a href="{$oUserProfile->getUserWebPath()}"><img src="{$oUserProfile->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a>
<div id="vote_area_user_{$oUserProfile->getId()}" class="vote {if $oUserProfile->getRating()>=0}vote-count-positive{else}vote-count-negative{/if} {if $oVote} voted {if $oVote->getDirection()>0}voted-up{elseif $oVote->getDirection()<0}voted-down{/if}{/if}">
@ -18,4 +19,5 @@
{if $oUserProfile->getProfileName()}
<p class="user-name">{$oUserProfile->getProfileName()|escape:'html'}</p>
{/if}
{hook run='profile_top_end' oUserProfile=$oUserProfile}
</div>

View file

@ -1,3 +1,4 @@
{hook run='profile_sidebar_begin' oUserProfile=$oUserProfile}
<section class="block block-type-profile">
<div class="profile-photo-wrapper">
<div class="status {if $oUserProfile->isOnline()}status-online{else}status-offline{/if}">{if $oUserProfile->isOnline()}{$aLang.user_status_online}{else}{$aLang.user_status_offline}{/if}</div>
@ -90,10 +91,11 @@
</section>
{/if}
{hook run='profile_sidebar_menu_before' oUserProfile=$oUserProfile}
<section class="block block-type-profile-nav">
<ul class="nav nav-profile">
{hook run='profile_sidebar_menu_item_first' oUserProfile=$oUserProfile}
<li {if $sAction=='profile' && ($aParams[0]=='whois' or $aParams[0]=='')}class="active"{/if}><a href="{$oUserProfile->getUserWebPath()}">{$aLang.user_menu_profile_whois}</a></li>
<li {if $sAction=='profile' && $aParams[0]=='wall'}class="active"{/if}><a href="{$oUserProfile->getUserWebPath()}wall/">{$aLang.user_menu_profile_wall}{if ($iCountWallUser)>0} ({$iCountWallUser}){/if}</a></li>
<li {if $sAction=='profile' && $aParams[0]=='created'}class="active"{/if}><a href="{$oUserProfile->getUserWebPath()}created/topics/">{$aLang.user_menu_publication}{if ($iCountCreated)>0} ({$iCountCreated}){/if}</a></li>
@ -105,5 +107,8 @@
<li {if $sAction=='talk'}class="active"{/if}><a href="{router page='talk'}">{$aLang.talk_menu_inbox}{if $iUserCurrentCountTalkNew} ({$iUserCurrentCountTalkNew}){/if}</a></li>
<li {if $sAction=='settings'}class="active"{/if}><a href="{router page='settings'}">{$aLang.settings_menu}</a></li>
{/if}
{hook run='profile_sidebar_menu_item_last' oUserProfile=$oUserProfile}
</ul>
</section>
{hook run='profile_sidebar_end' oUserProfile=$oUserProfile}

View file

@ -75,7 +75,7 @@
</table>
{/if}
{hook run='profile_whois_item_after_privat' oUserProfile=$oUserProfile}
{assign var="aUserFieldContactValues" value=$oUserProfile->getUserFieldValues(true,array('contact'))}
{if $aUserFieldContactValues}
@ -107,9 +107,6 @@
{/if}
{hook run='profile_whois_item' oUserProfile=$oUserProfile}
@ -215,5 +212,6 @@
{include file='user_list_avatar.tpl' aUsersList=$aUsersFriend}
{/if}
{hook run='profile_whois_item_end' oUserProfile=$oUserProfile}
{include file='footer.tpl'}

View file

@ -26,6 +26,7 @@
<h2 class="page-header">{$aLang.registration}</h2>
{hook run='registration_begin'}
<form action="{router page='registration'}" method="post" id="registration-form">
{hook run='form_registration_begin'}
@ -67,6 +68,6 @@
<button name="submit_register" class="button button-primary" id="registration-form-submit" disabled="disabled">{$aLang.registration_submit}</button>
</form>
{hook run='registration_end'}
{include file='footer.tpl'}

View file

@ -1,12 +1,16 @@
{include file='header.tpl'}
<h2 class="page-header">{$aLang.search}</h2>
{hook run='search_begin'}
<form action="{router page='search'}topics/" class="search">
{hook run='search_form_begin'}
<input type="text" placeholder="{$aLang.search}" maxlength="255" name="q" class="input-text">
<input type="submit" value="" title="{$aLang.search_submit}" class="input-submit icon icon-search">
{hook run='search_form_end'}
</form>
{hook run='search_end'}
{include file='footer.tpl'}

View file

@ -6,8 +6,10 @@
<form action="{router page='search'}topics/" class="search">
{hook run='search_form_begin'}
<input type="text" value="{$aReq.q|escape:'html'}" placeholder="{$aLang.search}" maxlength="255" name="q" class="input-text">
<input type="submit" value="" title="{$aLang.search_submit}" class="input-submit icon icon-search">
{hook run='search_form_end'}
</form>
@ -21,6 +23,8 @@
{$aLang.search_results_count_topics}
{elseif $sType=="comments"}
{$aLang.search_results_count_comments}
{else}
{hook run='search_result_item' sType=$sType}
{/if}
</a>
</li>
@ -32,6 +36,8 @@
{include file='topic_list.tpl'}
{elseif $aReq.sType == 'comments'}
{include file='comment_list.tpl'}
{else}
{hook run='search_result' sType=$aReq.sType}
{/if}
{else}
{$aLang.search_results_empty}

View file

@ -8,6 +8,7 @@
{include file='menu.settings.tpl'}
{hook run='settings_account_begin'}
<form method="post" enctype="multipart/form-data">
{hook run='form_settings_account_begin'}
@ -55,6 +56,6 @@
<button name="submit_account_edit" class="button button-primary" />{$aLang.settings_account_submit}</button>
</form>
{hook run='settings_account_end'}
{include file='footer.tpl'}

View file

@ -4,7 +4,10 @@
<small class="note note-header input-width-400">{$aLang.settings_invite_notice} "{$aLang.settings_invite_submit}"</small>
{hook run='settings_invite_begin'}
<form action="" method="POST" enctype="multipart/form-data">
{hook run='form_settings_invite_begin'}
<input type="hidden" name="security_ls_key" value="{$LIVESTREET_SECURITY_KEY}" />
<p>
@ -16,8 +19,11 @@
<input type="text" name="invite_mail" id="invite_mail" class="input-text input-width-200" /><br />
<small class="note">{$aLang.settings_invite_mail_notice}</small></p>
{hook run='form_settings_invite_end'}
<button name="submit_invite" class="button button-primary" />{$aLang.settings_invite_submit}</button>
</form>
{hook run='settings_invite_end'}
{include file='footer.tpl'}

View file

@ -27,6 +27,7 @@
<a class="icon-remove" title="{$aLang.user_field_delete}" href="#" onclick="return ls.userfield.removeFormField(this);"></a>
</p>
{hook run='settings_profile_begin'}
<form method="post" enctype="multipart/form-data" class="form-profile">
{hook run='form_settings_profile_begin'}
@ -199,6 +200,6 @@
<button name="submit_profile_edit" class="button button-primary" />{$aLang.settings_profile_submit}</button>
</form>
{hook run='settings_profile_end'}
{include file='footer.tpl'}

View file

@ -11,6 +11,8 @@
<small class="note note-header input-width-400">{$aLang.settings_tuning_notice}:</small>
{hook run='settings_tuning_begin'}
<form action="{router page='settings'}tuning/" method="POST" enctype="multipart/form-data">
{hook run='form_settings_tuning_begin'}
@ -29,6 +31,6 @@
<input type="submit" name="submit_settings_tuning" value="{$aLang.settings_tuning_submit}" class="button" />
</form>
{hook run='settings_tuning_end'}
{include file='footer.tpl'}

View file

@ -7,6 +7,7 @@
{include file='actions/ActionTalk/friends.tpl'}
{hook run='talk_add_begin'}
<div class="topic" style="display: none;">
<div class="content" id="text_preview"></div>
@ -33,5 +34,6 @@
<button class="button" name="submit_preview" onclick="jQuery('#text_preview').parent().show(); ls.tools.textPreview('talk_text',false); return false;">{$aLang.topic_create_submit_preview}</button>
</form>
{hook run='talk_add_end'}
{include file='footer.tpl'}

View file

@ -3,7 +3,8 @@
<input type="text" placeholder="{$aLang.search}" maxlength="255" name="q" class="input-text">
<input type="submit" value="" title="{$aLang.search_submit}" class="input-submit icon icon-search">
</form>
{hook run='userbar_nav'}
<ul class="nav nav-userbar">
{if $oUserCurrent}
@ -16,10 +17,10 @@
<li><a href="{router page='topic'}add/" class="write" id="modal_write_show">{$aLang.block_create}</a></li>
<li><a href="{router page='talk'}" {if $iUserCurrentCountTalkNew}class="new-messages"{/if} id="new_messages" title="{if $iUserCurrentCountTalkNew}{$aLang.user_privat_messages_new}{/if}">{$aLang.user_privat_messages}{if $iUserCurrentCountTalkNew} ({$iUserCurrentCountTalkNew}){/if}</a></li>
<li><a href="{router page='settings'}profile/">{$aLang.user_settings}</a></li>
<li><a href="{router page='login'}exit/?security_ls_key={$LIVESTREET_SECURITY_KEY}">{$aLang.exit}</a></li>
{hook run='userbar_item'}
<li><a href="{router page='login'}exit/?security_ls_key={$LIVESTREET_SECURITY_KEY}">{$aLang.exit}</a></li>
{else}
{hook run='userbar_item'}
<li><a href="{router page='login'}" class="js-login-form-show">{$aLang.user_login_submit}</a></li>
<li><a href="{router page='registration'}" class="js-registration-form-show">{$aLang.registration_submit}</a></li>
{/if}
@ -28,8 +29,10 @@
<header id="header" role="banner">
{hook run='header_banner_begin'}
<hgroup class="site-info">
<h1 class="site-name"><a href="{cfg name='path.root.web'}">{cfg name='view.name'}</a></h1>
<h2 class="site-description">{cfg name='view.description'}</h2>
</hgroup>
{hook run='header_banner_end'}
</header>

View file

@ -15,6 +15,6 @@
</li>
{/if}
{hook run='menu_profile_created_item'}
{hook run='menu_profile_created_item' oUserProfile=$oUserProfile}
</ul>
{hook run='menu_profile_created'}
{hook run='menu_profile_created' oUserProfile=$oUserProfile}

View file

@ -7,4 +7,8 @@
<li {if $sMenuSubItemSelect=='comments'}class="active"{/if}>
<a href="{$oUserProfile->getUserWebPath()}favourites/comments/">{$aLang.user_menu_profile_favourites_comments} {if $iCountCommentFavourite} ({$iCountCommentFavourite}) {/if}</a>
</li>
{hook run='menu_profile_favourite_item' oUserProfile=$oUserProfile}
</ul>
{hook run='menu_profile_favourite' oUserProfile=$oUserProfile}

View file

@ -5,6 +5,7 @@
<li {if $sMenuHeadItemSelect=='people'}class="active"{/if}><a href="{router page='people'}">{$aLang.people}</a></li>
<li {if $sMenuHeadItemSelect=='stream'}class="active"{/if}><a href="{router page='stream'}">{$aLang.stream_menu}</a></li>
{hook run='main_menu'}
{hook run='main_menu_item'}
</ul>
{hook run='main_menu'}
</nav>

View file

@ -1,5 +1,6 @@
{if $bIsShowStatsPerformance and $oUserCurrent and $oUserCurrent->isAdministrator()}
<div class="stat-performance">
<div class="stat-performance">
{hook run='statistics_performance_begin'}
<table>
<tr>
<td>
@ -19,7 +20,9 @@
time load modules: <strong>{$aStatsPerformance.engine.time_load_module}</strong><br />
full time: <strong>{$iTimeFullPerformance}</strong>
</td>
{hook run='statistics_performance_item'}
</tr>
</table>
{hook run='statistics_performance_end'}
</div>
{/if}

View file

@ -1,2 +1,4 @@
{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
{include file=$sTopicTemplateName}
{if $LS->Topic_IsAllowTopicType($oTopic->getType())}
{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
{include file=$sTopicTemplateName}
{/if}

View file

@ -1,12 +1,14 @@
{if count($aTopics)>0}
{add_block group='toolbar' name='toolbar_topic.tpl' iCountTopic=count($aTopics)}
{foreach from=$aTopics item=oTopic}
{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
{include file=$sTopicTemplateName bTopicList=true}
{/foreach}
{include file='paging.tpl' aPaging=$aPaging}
{foreach from=$aTopics item=oTopic}
{if $LS->Topic_IsAllowTopicType($oTopic->getType())}
{assign var="sTopicTemplateName" value="topic_`$oTopic->getType()`.tpl"}
{include file=$sTopicTemplateName bTopicList=true}
{/if}
{/foreach}
{include file='paging.tpl' aPaging=$aPaging}
{else}
{$aLang.blog_no_topic}
{/if}

View file

@ -39,7 +39,9 @@
<form method="POST" action="" enctype="multipart/form-data" id="block_upload_img_content_link" onsubmit="return false;" style="display: none;" class="tab-content">
<p><label for="img_file">{$aLang.uploadimg_url}:</label>
<input type="text" name="img_url" id="img_url" value="http://" class="input-text input-width-full" /></p>
{hook run="uploadimg_link_additional"}
<button class="button button-primary" onclick="ls.topic.insertImageToEditor(jQuery('#img_url').val());">{$aLang.uploadimg_link_submit_paste}</button>
{$aLang.or}
<button class="button button-primary" onclick="ls.ajaxUploadImg('block_upload_img_content_link','{$sToLoad}');">{$aLang.uploadimg_link_submit_load}</button>

View file

@ -29,6 +29,7 @@
<div id="block_popup_login_content_login" class="tab-content">
{hook run='login_popup_begin'}
<form action="{router page='login'}" method="post" id="popup-login-form">
{hook run='form_login_popup_begin'}
@ -46,6 +47,7 @@
<input type="hidden" name="return-path" value="{$PATH_WEB_CURRENT|escape:'html'}">
<button name="submit_login" class="button button-primary" id="popup-login-form-submit" disabled="disabled">{$aLang.user_login_submit}</button>
</form>
{hook run='login_popup_end'}
</div>
@ -74,7 +76,7 @@
});
</script>
{hook run='registration_begin' isPopup=true}
<form action="{router page='registration'}" method="post" id="popup-registration-form">
{hook run='form_registration_begin' isPopup=true}
@ -115,6 +117,7 @@
<input type="hidden" name="return-path" value="{$PATH_WEB_CURRENT|escape:'html'}">
<button name="submit_register" class="button button-primary" id="popup-registration-form-submit" disabled="disabled">{$aLang.registration_submit}</button>
</form>
{hook run='registration_end' isPopup=true}
</div>
{/if}

View file

@ -31,6 +31,7 @@
<a href="{router page='topic'}saved/" class="write-item-image"></a>
<a href="{router page='topic'}saved/" class="write-item-link">{$aLang.topic_menu_saved} {if $iUserCurrentCountTopicDraft}({$iUserCurrentCountTopicDraft}){/if}</a>
</li>
{hook run='write_item' isPopup=true}
</ul>
</div>
{/strip}