You've already forked joomla_test
first commit
This commit is contained in:
209
modules/mod_k2_user/helper.php
Normal file
209
modules/mod_k2_user/helper.php
Normal file
@ -0,0 +1,209 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: helper.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
JLoader::register('K2HelperRoute', JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'route.php');
|
||||
JLoader::register('K2HelperUtilities', JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'utilities.php');
|
||||
|
||||
class modK2UserHelper
|
||||
{
|
||||
|
||||
public static function getReturnURL($params, $type)
|
||||
{
|
||||
|
||||
if ($itemid = $params->get($type))
|
||||
{
|
||||
$application = JFactory::getApplication();
|
||||
$menu = $application->getMenu();
|
||||
$item = $menu->getItem($itemid);
|
||||
$url = JRoute::_($item->link.'&Itemid='.$itemid, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// stay on the same page
|
||||
$uri = JFactory::getURI();
|
||||
$url = $uri->toString(array('path', 'query', 'fragment'));
|
||||
}
|
||||
|
||||
return base64_encode($url);
|
||||
}
|
||||
|
||||
public static function getType()
|
||||
{
|
||||
|
||||
$user = JFactory::getUser();
|
||||
return (!$user->get('guest')) ? 'logout' : 'login';
|
||||
}
|
||||
|
||||
public static function getProfile(&$params)
|
||||
{
|
||||
|
||||
$user = JFactory::getUser();
|
||||
$db = JFactory::getDBO();
|
||||
$query = "SELECT * FROM #__k2_users WHERE userID=".(int)$user->id;
|
||||
$db->setQuery($query, 0, 1);
|
||||
$profile = $db->loadObject();
|
||||
|
||||
if ($profile)
|
||||
{
|
||||
if ($profile->image != '')
|
||||
$profile->avatar = JURI::root().'media/k2/users/'.$profile->image;
|
||||
|
||||
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'permissions'.'.php');
|
||||
|
||||
if (JRequest::getCmd('option') != 'com_k2')
|
||||
K2HelperPermissions::setPermissions();
|
||||
|
||||
if (K2HelperPermissions::canAddItem())
|
||||
$profile->addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
|
||||
|
||||
return $profile;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function countUserComments($userID)
|
||||
{
|
||||
|
||||
$db = JFactory::getDBO();
|
||||
$query = "SELECT COUNT(*) FROM #__k2_comments WHERE userID=".(int)$userID." AND published=1";
|
||||
$db->setQuery($query);
|
||||
$result = $db->loadResult();
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
public static function getMenu($params)
|
||||
{
|
||||
$items = array();
|
||||
$children = array();
|
||||
if ($params->get('menu'))
|
||||
{
|
||||
$menu = JSite::getMenu();
|
||||
$items = $menu->getItems('menutype', $params->get('menu'));
|
||||
}
|
||||
foreach ($items as $item)
|
||||
{
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$item->name = $item->title;
|
||||
$item->parent = $item->parent_id;
|
||||
}
|
||||
$index = $item->parent;
|
||||
$list = @$children[$index] ? $children[$index] : array();
|
||||
array_push($list, $item);
|
||||
$children[$index] = $list;
|
||||
}
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$items = JHTML::_('menu.treerecurse', 1, '', array(), $children, 9999, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$items = JHTML::_('menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
|
||||
}
|
||||
$links = array();
|
||||
foreach ($items as $item)
|
||||
{
|
||||
if (K2_JVERSION == '15')
|
||||
{
|
||||
$item->level = $item->sublevel;
|
||||
switch ($item->type)
|
||||
{
|
||||
case 'separator' :
|
||||
continue;
|
||||
break;
|
||||
|
||||
case 'url' :
|
||||
if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false))
|
||||
{
|
||||
$item->url = $item->link.'&Itemid='.$item->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->url = $item->link;
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
$router = JSite::getRouter();
|
||||
$item->url = $router->getMode() == JROUTER_MODE_SEF ? 'index.php?Itemid='.$item->id : $item->link.'&Itemid='.$item->id;
|
||||
break;
|
||||
}
|
||||
|
||||
$iParams = class_exists('JParameter') ? new JParameter($item->params) : new JRegistry($item->params);
|
||||
$iSecure = $iParams->def('secure', 0);
|
||||
if ($item->home == 1)
|
||||
{
|
||||
$item->url = JURI::base();
|
||||
}
|
||||
elseif (strcasecmp(substr($item->url, 0, 4), 'http') && (strpos($item->link, 'index.php?') !== false))
|
||||
{
|
||||
$item->url = JRoute::_($item->url, true, $iSecure);
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->url = str_replace('&', '&', $item->url);
|
||||
}
|
||||
$item->route = $item->url;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$item->flink = $item->link;
|
||||
switch ($item->type)
|
||||
{
|
||||
case 'separator' :
|
||||
continue;
|
||||
|
||||
case 'url' :
|
||||
if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false))
|
||||
{
|
||||
$item->flink = $item->link.'&Itemid='.$item->id;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'alias' :
|
||||
$item->flink = 'index.php?Itemid='.$item->params->get('aliasoptions');
|
||||
break;
|
||||
|
||||
default :
|
||||
$router = JSite::getRouter();
|
||||
if ($router->getMode() == JROUTER_MODE_SEF)
|
||||
{
|
||||
$item->flink = 'index.php?Itemid='.$item->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->flink .= '&Itemid='.$item->id;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (strcasecmp(substr($item->flink, 0, 4), 'http') && (strpos($item->flink, 'index.php?') !== false))
|
||||
{
|
||||
$item->flink = JRoute::_($item->flink, true, $item->params->get('secure'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$item->flink = JRoute::_($item->flink);
|
||||
}
|
||||
|
||||
$item->route = $item->flink;
|
||||
|
||||
}
|
||||
$links[] = $item;
|
||||
}
|
||||
return $links;
|
||||
}
|
||||
|
||||
}
|
1
modules/mod_k2_user/index.html
Normal file
1
modules/mod_k2_user/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
88
modules/mod_k2_user/mod_k2_user.php
Normal file
88
modules/mod_k2_user/mod_k2_user.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: mod_k2_user.php 1972 2013-05-01 16:26:58Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die ;
|
||||
|
||||
if (K2_JVERSION != '15')
|
||||
{
|
||||
$language = JFactory::getLanguage();
|
||||
$language->load('mod_k2.j16', JPATH_ADMINISTRATOR, null, true);
|
||||
}
|
||||
|
||||
require_once (dirname(__FILE__).DS.'helper.php');
|
||||
|
||||
$moduleclass_sfx = $params->get('moduleclass_sfx', '');
|
||||
$userGreetingText = $params->get('userGreetingText', '');
|
||||
$userAvatarWidthSelect = $params->get('userAvatarWidthSelect', 'custom');
|
||||
$userAvatarWidth = $params->get('userAvatarWidth', 50);
|
||||
|
||||
// Legacy params
|
||||
$greeting = 0;
|
||||
|
||||
$type = modK2UserHelper::getType();
|
||||
$return = modK2UserHelper::getReturnURL($params, $type);
|
||||
$user = JFactory::getUser();
|
||||
|
||||
$componentParams = JComponentHelper::getParams('com_k2');
|
||||
$K2CommentsEnabled = $componentParams->get('comments');
|
||||
|
||||
// User avatar
|
||||
if ($userAvatarWidthSelect == 'inherit')
|
||||
{
|
||||
$avatarWidth = $componentParams->get('userImageWidth');
|
||||
}
|
||||
else
|
||||
{
|
||||
$avatarWidth = $userAvatarWidth;
|
||||
}
|
||||
|
||||
// Load the right template
|
||||
if ($user->guest)
|
||||
{
|
||||
// OpenID stuff (do not edit)
|
||||
if (JPluginHelper::isEnabled('authentication', 'openid'))
|
||||
{
|
||||
$lang->load('plg_authentication_openid', JPATH_ADMINISTRATOR);
|
||||
$langScript = '
|
||||
var JLanguage = {};
|
||||
JLanguage.WHAT_IS_OPENID = \''.JText::_('K2_WHAT_IS_OPENID').'\';
|
||||
JLanguage.LOGIN_WITH_OPENID = \''.JText::_('K2_LOGIN_WITH_OPENID').'\';
|
||||
JLanguage.NORMAL_LOGIN = \''.JText::_('K2_NORMAL_LOGIN').'\';
|
||||
var modlogin = 1;
|
||||
';
|
||||
$document = JFactory::getDocument();
|
||||
$document->addScriptDeclaration($langScript);
|
||||
JHTML::_('script', 'openid.js');
|
||||
}
|
||||
|
||||
// Get user stuff (do not edit)
|
||||
$usersConfig = JComponentHelper::getParams('com_users');
|
||||
|
||||
// Define some variables depending on Joomla! version
|
||||
$passwordFieldName = K2_JVERSION != '15' ? 'password' : 'passwd';
|
||||
$resetLink = JRoute::_((K2_JVERSION != '15') ? 'index.php?option=com_users&view=reset' : 'index.php?option=com_user&view=reset');
|
||||
$remindLink = JRoute::_((K2_JVERSION != '15') ? 'index.php?option=com_users&view=remind' : 'index.php?option=com_user&view=remind');
|
||||
$registrationLink = JRoute::_((K2_JVERSION != '15') ? 'index.php?option=com_users&view=registration' : 'index.php?option=com_user&view=register');
|
||||
$option = K2_JVERSION != '15' ? 'com_users' : 'com_user';
|
||||
$task = K2_JVERSION != '15' ? 'user.login' : 'login';
|
||||
require (JModuleHelper::getLayoutPath('mod_k2_user', 'login'));
|
||||
}
|
||||
else
|
||||
{
|
||||
JHTML::_('behavior.modal');
|
||||
|
||||
$user->profile = modK2UserHelper::getProfile($params);
|
||||
$user->numOfComments = modK2UserHelper::countUserComments($user->id);
|
||||
$menu = modK2UserHelper::getMenu($params);
|
||||
$profileLink = JRoute::_((K2_JVERSION != '15') ? 'index.php?option=com_users&view=profile&layout=edit' : 'index.php?option=com_user&view=user&task=edit');
|
||||
$option = K2_JVERSION != '15' ? 'com_users' : 'com_user';
|
||||
$task = K2_JVERSION != '15' ? 'user.logout' : 'logout';
|
||||
require (JModuleHelper::getLayoutPath('mod_k2_user', 'userblock'));
|
||||
}
|
58
modules/mod_k2_user/mod_k2_user.xml
Normal file
58
modules/mod_k2_user/mod_k2_user.xml
Normal file
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="module" client="site" version="2.5" method="upgrade">
|
||||
<name>K2 User</name>
|
||||
<author>JoomlaWorks</author>
|
||||
<creationDate>July 8th, 2013</creationDate>
|
||||
<copyright>Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.</copyright>
|
||||
<authorEmail>please-use-the-contact-form@joomlaworks.net</authorEmail>
|
||||
<authorUrl>www.joomlaworks.net</authorUrl>
|
||||
<version>2.6.7</version>
|
||||
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
|
||||
<description>K2_MOD_K2_USER_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_k2_user">mod_k2_user.php</filename>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements/">
|
||||
<field name="moduleclass_sfx" type="text" default="" label="K2_MODULE_CLASS_SUFFIX" description="K2_MODULE_CLASS_SUFFIX_DESCRIPTION" />
|
||||
<field name="pretext" type="textarea" cols="30" rows="5" default="" label="K2_PRETEXT" description="" />
|
||||
<field name="posttext" type="textarea" cols="30" rows="5" label="K2_POSTTEXT" description="" />
|
||||
<field name="" type="header" default="K2_OPTIONS_FOR_LOGGED_IN_USERS" label="" description="" />
|
||||
<field name="userGreetingText" type="textarea" cols="30" rows="5" label="K2_GREETING_TEXT" description="K2_WRITE_A_CUSTOM_TEXT_TO_DISPLAY_TO_YOUR_USERS_WHEN_THEY_ARE_LOGGED_IN" />
|
||||
<field name="name" type="list" default="1" label="K2_DISPLAY_USERNAME_OR_NAME" description="">
|
||||
<option value="0">K2_USERNAME</option>
|
||||
<option value="1">K2_NAME</option>
|
||||
</field>
|
||||
<field name="userAvatar" type="radio" default="1" label="K2_USER_AVATAR" description="">
|
||||
<option value="0">K2_HIDE</option>
|
||||
<option value="1">K2_SHOW</option>
|
||||
</field>
|
||||
<field name="userAvatarWidthSelect" type="list" default="custom" label="K2_USER_AVATAR_WIDTH" description="">
|
||||
<option value="inherit">K2_INHERIT_FROM_COMPONENT_PARAMETERS</option>
|
||||
<option value="custom">K2_USE_CUSTOM_WIDTH</option>
|
||||
</field>
|
||||
<field name="userAvatarWidth" type="text" default="50" size="4" label="K2_CUSTOM_WIDTH_FOR_USER_AVATAR_IN_PX" description="" />
|
||||
<field name="" type="header" default="K2_MENU_RENDER_OPTION" label="" description="" />
|
||||
<field name="menu" type="menus" default="" label="K2_MENU_TO_RENDER" description="K2_MENU_TO_RENDER_DESC" />
|
||||
<field name="" type="header" default="K2_LOGIN_LOGOUT_REDIRECTION" label="" description="" />
|
||||
<field name="login" type="menuitem" default="" disable="separator" label="K2_LOGIN_REDIRECTION_URL" description="K2_LOGIN_REDIRECTION_URL_DESCRIPTION" />
|
||||
<field name="logout" type="menuitem" default="" disable="separator" label="K2_LOGOUT_REDIRECTION_URL" description="K2_LOGOUT_REDIRECTION_URL_DESCRIPTION" />
|
||||
<field name="usesecure" type="radio" default="0" label="K2_ENCRYPT_LOGIN_FORM" description="K2_SUBMIT_ENCRYPTED_LOGIN_DATA_REQUIRES_SSL">
|
||||
<option value="0">K2_NO</option>
|
||||
<option value="1">K2_YES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field name="cache" type="list" default="0" label="K2_CACHING" description="K2_SELECT_WHETHER_TO_CACHE_THE_CONTENT_OF_THIS_MODULE">
|
||||
<option value="1">K2_USE_GLOBAL</option>
|
||||
<option value="0">K2_NO_CACHING</option>
|
||||
</field>
|
||||
<field name="cache_time" type="text" default="900" label="K2_CACHE_TIME" description="K2_THE_TIME_IN_SECONDS_BEFORE_THE_MODULE_IS_RECACHED" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
57
modules/mod_k2_user/tmpl/login.php
Normal file
57
modules/mod_k2_user/tmpl/login.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: login.php 1812 2013-01-14 18:45:06Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2LoginBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
|
||||
<form action="<?php echo JRoute::_('index.php', true, $params->get('usesecure')); ?>" method="post" name="login" id="form-login">
|
||||
<?php if($params->get('pretext')): ?>
|
||||
<p class="preText"><?php echo $params->get('pretext'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<fieldset class="input">
|
||||
<p id="form-login-username">
|
||||
<label for="modlgn_username"><?php echo JText::_('K2_USERNAME') ?></label>
|
||||
<input id="modlgn_username" type="text" name="username" class="inputbox" size="18" />
|
||||
</p>
|
||||
<p id="form-login-password">
|
||||
<label for="modlgn_passwd"><?php echo JText::_('K2_PASSWORD') ?></label>
|
||||
<input id="modlgn_passwd" type="password" name="<?php echo $passwordFieldName; ?>" class="inputbox" size="18" />
|
||||
</p>
|
||||
<?php if(JPluginHelper::isEnabled('system', 'remember')): ?>
|
||||
<p id="form-login-remember">
|
||||
<label for="modlgn_remember"><?php echo JText::_('K2_REMEMBER_ME') ?></label>
|
||||
<input id="modlgn_remember" type="checkbox" name="remember" class="inputbox" value="yes" />
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="submit" name="Submit" class="button" value="<?php echo JText::_('K2_LOGIN') ?>" />
|
||||
</fieldset>
|
||||
|
||||
<ul>
|
||||
<li><a href="<?php echo $resetLink; ?>"><?php echo JText::_('K2_FORGOT_YOUR_PASSWORD'); ?></a></li>
|
||||
<li><a href="<?php echo $remindLink ?>"><?php echo JText::_('K2_FORGOT_YOUR_USERNAME'); ?></a></li>
|
||||
<?php if ($usersConfig->get('allowUserRegistration')): ?>
|
||||
<li><a href="<?php echo $registrationLink; ?>"><?php echo JText::_('K2_CREATE_AN_ACCOUNT'); ?></a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php if($params->get('posttext')): ?>
|
||||
<p class="postText"><?php echo $params->get('posttext'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo $task; ?>" />
|
||||
<input type="hidden" name="return" value="<?php echo $return; ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
</div>
|
83
modules/mod_k2_user/tmpl/userblock.php
Normal file
83
modules/mod_k2_user/tmpl/userblock.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* @version $Id: userblock.php 1972 2013-05-01 16:26:58Z lefteris.kavadas $
|
||||
* @package K2
|
||||
* @author JoomlaWorks http://www.joomlaworks.net
|
||||
* @copyright Copyright (c) 2006 - 2013 JoomlaWorks Ltd. All rights reserved.
|
||||
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
|
||||
*/
|
||||
|
||||
// no direct access
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
?>
|
||||
|
||||
<div id="k2ModuleBox<?php echo $module->id; ?>" class="k2UserBlock<?php if($params->get('moduleclass_sfx')) echo ' '.$params->get('moduleclass_sfx'); ?>">
|
||||
|
||||
<?php if($userGreetingText): ?>
|
||||
<p class="ubGreeting"><?php echo $userGreetingText; ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="k2UserBlockDetails">
|
||||
<?php if($params->get('userAvatar')): ?>
|
||||
<a class="k2Avatar ubAvatar" href="<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>" title="<?php echo JText::_('K2_MY_PAGE'); ?>">
|
||||
<img src="<?php echo K2HelperUtilities::getAvatar($user->id, $user->email); ?>" alt="<?php echo K2HelperUtilities::cleanHtml($user->name); ?>" style="width:<?php echo $avatarWidth; ?>px;height:auto;" />
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<span class="ubName"><?php echo $user->name; ?></span>
|
||||
<span class="ubCommentsCount"><?php echo JText::_('K2_YOU_HAVE'); ?> <b><?php echo $user->numOfComments; ?></b> <?php if($user->numOfComments==1) echo JText::_('K2_PUBLISHED_COMMENT'); else echo JText::_('K2_PUBLISHED_COMMENTS'); ?></span>
|
||||
<div class="clr"></div>
|
||||
</div>
|
||||
|
||||
<ul class="k2UserBlockActions">
|
||||
<?php if(is_object($user->profile) && isset($user->profile->addLink)): ?>
|
||||
<li>
|
||||
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $user->profile->addLink; ?>"><?php echo JText::_('K2_ADD_NEW_ITEM'); ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li>
|
||||
<a href="<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>"><?php echo JText::_('K2_MY_PAGE'); ?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo $profileLink; ?>"><?php echo JText::_('K2_MY_ACCOUNT'); ?></a>
|
||||
</li>
|
||||
<?php if($K2CommentsEnabled): ?>
|
||||
<li>
|
||||
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&tmpl=component'); ?>"><?php echo JText::_('K2_MODERATE_COMMENTS_TO_MY_PUBLISHED_ITEMS'); ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<ul class="k2UserBlockRenderedMenu">
|
||||
<?php $level = 1; foreach($menu as $key => $link): $level++; ?>
|
||||
<li class="linkItemId<?php echo $link->id; ?>">
|
||||
<?php if($link->type=='url' && $link->browserNav==0): ?>
|
||||
<a href="<?php echo $link->route; ?>"><?php echo $link->name; ?></a>
|
||||
<?php elseif(strpos($link->link,'option=com_k2&view=item&layout=itemform') || $link->browserNav==2): ?>
|
||||
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $link->route; ?>"><?php echo $link->name; ?></a>
|
||||
<?php else: ?>
|
||||
<a href="<?php echo $link->route; ?>"<?php if($link->browserNav==1) echo ' target="_blank"'; ?>><?php echo $link->name; ?></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(isset($menu[$key+1]) && $menu[$key]->level < $menu[$key+1]->level): ?>
|
||||
<ul>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(isset($menu[$key+1]) && $menu[$key]->level > $menu[$key+1]->level): ?>
|
||||
<?php echo str_repeat('</li></ul>', $menu[$key]->level - $menu[$key+1]->level); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(isset($menu[$key+1]) && $menu[$key]->level == $menu[$key+1]->level): ?>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<form action="<?php echo JURI::root(true); ?>/index.php" method="post">
|
||||
<input type="submit" name="Submit" class="button ubLogout" value="<?php echo JText::_('K2_LOGOUT'); ?>" />
|
||||
<input type="hidden" name="option" value="<?php echo $option; ?>" />
|
||||
<input type="hidden" name="task" value="<?php echo $task; ?>" />
|
||||
<input type="hidden" name="return" value="<?php echo $return; ?>" />
|
||||
<?php echo JHTML::_( 'form.token' ); ?>
|
||||
</form>
|
||||
</div>
|
Reference in New Issue
Block a user