当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::User方法代码示例

本文整理汇总了PHP中CBLib\Application\Application::User方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::User方法的具体用法?PHP Application::User怎么用?PHP Application::User使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBLib\Application\Application的用法示例。


在下文中一共展示了Application::User方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showBlogEdit

 /**
  * @param  OrderedTable  $row
  * @param  string[]      $input
  * @param  UserTable     $user
  * @param  stdClass      $model
  * @param  PluginTable   $plugin
  */
 static function showBlogEdit($row, $input, $user, $model, $plugin)
 {
     global $_CB_framework, $_PLUGINS;
     cbValidator::loadValidation();
     $blogMode = $plugin->params->get('blog_mode', 1);
     $pageTitle = $row->get('id') ? CBTxt::T('Edit Blog') : CBTxt::T('Create Blog');
     $cbModerator = Application::User((int) $user->get('id'))->isGlobalModerator();
     $_CB_framework->setPageTitle($pageTitle);
     $_CB_framework->appendPathWay(htmlspecialchars(CBTxt::T('Blogs')), $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), true, 'cbblogsTab'));
     $_CB_framework->appendPathWay(htmlspecialchars($pageTitle), $_CB_framework->pluginClassUrl($plugin->element, true, $row->get('id') ? array('action' => 'blogs', 'func' => 'edit', 'id' => (int) $row->get('id')) : array('action' => 'blogs', 'func' => 'new')));
     initToolTip();
     $return = '<div class="blogEdit">' . '<form action="' . $_CB_framework->pluginClassUrl($plugin->element, true, array('action' => 'blogs', 'func' => 'save', 'id' => (int) $row->get('id'))) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">' . ($pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null);
     if ($cbModerator || !$plugin->params->get('blog_approval', 0)) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="published" class="col-sm-3 control-label">' . CBTxt::Th('Published') . '</label>' . '<div class="cb_field col-sm-9">' . $input['published'] . getFieldIcons(1, 0, null, CBTxt::T('Select publish status of the blog. Unpublished blogs will not be visible to the public.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_category_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="category" class="col-sm-3 control-label">' . CBTxt::Th('Category') . '</label>' . '<div class="cb_field col-sm-9">' . $input['category'] . getFieldIcons(1, 0, null, CBTxt::T('Select blog category. Select the category that best describes your blog.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_access_config', 1) || $cbModerator) {
         $return .= '<div class="cbft_select cbtt_select form-group cb_form_line clearfix">' . '<label for="access" class="col-sm-3 control-label">' . CBTxt::Th('Access') . '</label>' . '<div class="cb_field col-sm-9">' . $input['access'] . getFieldIcons(1, 0, null, CBTxt::T('Select access to blog; all groups above that level will also have access to the blog.')) . '</div>' . '</div>';
     }
     $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="title" class="col-sm-3 control-label">' . CBTxt::Th('Title') . '</label>' . '<div class="cb_field col-sm-9">' . $input['title'] . getFieldIcons(1, 1, null, CBTxt::T('Input blog title. This is the title that will distinguish this blog from others. Suggested to input something unique and intuitive.')) . '</div>' . '</div>';
     if (in_array($blogMode, array(1, 2))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_intro" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Intro') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_intro'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog intro contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if (in_array($blogMode, array(1, 3))) {
         $return .= '<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">' . '<label for="blog_full" class="col-sm-3 control-label">' . ($blogMode == 1 ? CBTxt::T('Blog Full') : CBTxt::T('Blog')) . '</label>' . '<div class="cb_field col-sm-9">' . $input['blog_full'] . getFieldIcons(1, 0, null, CBTxt::T('Input HTML supported blog contents. Suggested to use minimal but well formatting for easy readability.')) . '</div>' . '</div>';
     }
     if ($cbModerator) {
         $return .= '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">' . '<label for="user" class="col-sm-3 control-label">' . CBTxt::T('Owner') . '</label>' . '<div class="cb_field col-sm-9">' . $input['user'] . getFieldIcons(1, 1, null, CBTxt::T('Input owner of blog as single integer user_id.')) . '</div>' . '</div>';
     }
     if ($plugin->params->get('blog_captcha', 0) && !$cbModerator) {
         $_PLUGINS->loadPluginGroup('user');
         $captcha = $_PLUGINS->trigger('onGetCaptchaHtmlElements', array(false));
         if (!empty($captcha)) {
             $captcha = $captcha[0];
             $return .= '<div class="form-group cb_form_line clearfix">' . '<label class="col-sm-3 control-label">' . CBTxt::Th('Captcha') . '</label>' . '<div class="cb_field col-sm-9">' . (isset($captcha[0]) ? $captcha[0] : null) . '</div>' . '</div>' . '<div class="form-group cb_form_line clearfix">' . '<div class="cb_field col-sm-offset-3 col-sm-9">' . str_replace('inputbox', 'form-control', isset($captcha[1]) ? $captcha[1] : null) . getFieldIcons(1, 1, null) . '</div>' . '</div>';
         }
     }
     $return .= '<div class="form-group cb_form_line clearfix">' . '<div class="col-sm-offset-3 col-sm-9">' . '<input type="submit" value="' . htmlspecialchars($row->get('id') ? CBTxt::T('Update Blog') : CBTxt::T('Create Blog')) . '" class="blogsButton blogsButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;' . ' <input type="button" value="' . htmlspecialchars(CBTxt::T('Cancel')) . '" class="blogsButton blogsButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes(CBTxt::T('Are you sure you want to cancel? All unsaved data will be lost!')) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl($row->get('user', $user->get('id')), false, 'cbblogsTab') . '\'; }" />' . '</div>' . '</div>' . cbGetSpoofInputTag('plugin') . '</form>' . '</div>';
     echo $return;
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:49,代码来源:blog_edit.php

示例2: _authorizedEdit

 /**
  * Checks user access permission
  *
  * @param  int $userIdPosted
  * @return null|string
  */
 private function _authorizedEdit($userIdPosted)
 {
     global $_CB_framework;
     $iAmAdmin = Application::MyUser()->isSuperAdmin();
     if (!$iAmAdmin) {
         if (Application::MyUser()->isAuthorizedToPerformActionOnAsset('core.manage', 'com_users')) {
             if ($userIdPosted == 0) {
                 $action = 'core.create';
             } elseif ($userIdPosted == $_CB_framework->myId()) {
                 $action = 'core.edit.own';
             } else {
                 $action = 'core.edit';
             }
             $iAmAdmin = Application::MyUser()->isAuthorizedToPerformActionOnAsset($action, 'com_users') && !Application::User((int) $userIdPosted)->isSuperAdmin();
         }
     }
     if (!$iAmAdmin) {
         return CBTxt::T("Not Authorized");
     } else {
         return null;
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:28,代码来源:controller.user.php

示例3: showFolder

	/**
	 * @param cbgalleryFolderTable $row
	 * @param string               $type
	 * @param UserTable            $viewer
	 * @param UserTable            $user
	 * @param TabTable             $tab
	 * @param cbTabHandler         $plugin
	 * @return string
	 */
	static public function showFolder( $row, $type, $viewer, $user, $tab, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$_PLUGINS->trigger( 'gallery_onBeforeDisplayFolder', array( &$row, $type, $viewer, $user, $tab, $plugin ) );

		/** @var Registry $params */
		$params							=	$tab->params;

		switch( $type ) {
			case 'photos':
				$galleryType			=	CBTxt::T( 'Photos' );
				break;
			case 'files':
				$galleryType			=	CBTxt::T( 'Files' );
				break;
			case 'videos':
				$galleryType			=	CBTxt::T( 'Videos' );
				break;
			case 'music':
				$galleryType			=	CBTxt::T( 'Music' );
				break;
			default:
				$galleryType			=	CBTxt::T( 'Items' );
				break;
		}

		switch( $type ) {
			case 'photos':
			case 'videos':
			case 'music':
				$typeTranslated			=	CBTxt::T( 'Album' );
				break;
			default:
				$typeTranslated			=	CBTxt::T( 'Folder' );
				break;
		}

		$profileOwner					=	( $viewer->get( 'id' ) == $user->get( 'id' ) );
		$cbModerator					=	Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator();
		$date							=	cbFormatDate( $row->get( 'date' ), true, (int) $params->get( 'tab_' . $type . '_folder_items_time_display', 0 ), $params->get( 'tab_' . $type . '_folder_items_date_format', 'F j, Y' ), $params->get( 'tab_' . $type . '_folder_items_time_format', ' g:h A' ) );

		$return							=	'<div class="galleryFolderTitle page-header clearfix">'
										.		'<h3 class="row">'
										.			'<div class="col-sm-8 text-left">'
										.				( $row->get( 'title' ) ? htmlspecialchars( $row->get( 'title' ) ) . ( $row->get( 'id' ) !== 0 ? '<div class="small" title="' . htmlspecialchars( $row->get( 'date' ) ) . '">' . $date . '</div>' : null ) : $date )
										.			'</div>'
										.			'<div class="col-sm-4 text-right">'
										.				'<small>'
										.					'<a href="' . $_CB_framework->userProfileUrl( (int) $user->get( 'id' ), true, (int) $tab->get( 'tabid' ) ) . '">'
										.						CBuser::getInstance( (int) $row->get( 'user_id' ), false )->getField( 'formatname', null, 'html', 'none', 'profile', 0, true )
										.					'</a>'
										.				'</small>';

		if ( ( $row->get( 'id' ) !== 0 ) && ( $cbModerator || $profileOwner ) ) {
			$menuItems					=	'<ul class="galleryFolderMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">'
										.		'<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'edit', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>';

			if ( ( $row->get( 'published' ) == -1 ) && $plugin->params->get( $type . '_folder_approval', 0 ) ) {
				if ( $cbModerator ) {
					$menuItems			.=		'<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'publish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Approve' ) . '</a></li>';
				}
			} elseif ( $row->get( 'published' ) > 0 ) {
				$menuItems				.=		'<li class="galleryFolderMenuItem"><a href="javascript: void(0);" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'FOLDER_UNPUBLISH_TYPE', 'Are you sure you want to unpublish this [type]?', array( '[type]' => $typeTranslated ) ) ) . '\' ) ) { location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'folders', 'func' => 'unpublish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '\'; }"><span class="fa fa-times-circle"></span> ' . CBTxt::T( 'Unpublish' ) . '</a></li>';
			} else {
				$menuItems				.=		'<li class="galleryFolderMenuItem"><a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'publish', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ), 'folder' => true ) ) . '"><span class="fa fa-check"></span> ' . CBTxt::T( 'Publish' ) . '</a></li>';
			}

			$menuItems					.=		'<li class="galleryFolderMenuItem"><a href="javascript: void(0);" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'FOLDER_DELETE_TYPE', 'Are you sure you want to delete this [folder_type] and all its [item_type]?', array( '[folder_type]' => $typeTranslated, '[item_type]' => $galleryType ) ) ) . '\' ) ) { location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'folders', 'func' => 'delete', 'type' => $type, 'id' => (int) $row->get( 'id' ), 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ) ) ) . '\'; }"><span class="fa fa-trash-o"></span> ' . CBTxt::T( 'Delete' ) . '</a></li>'
										.	'</ul>';

			$menuAttr					=	cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );

			$return						.=				'<div class="folderMenu">'
										.					'<div class="galleryFolderMenu btn-group">'
										.						'<button type="button" ' . trim( $menuAttr ) . '><span class="fa fa-cog"></span> <span class="fa fa-caret-down"></span></button>'
										.					'</div>'
										.				'</div>';
		}

		$return							.=			'</div>'
										.		'</h3>'
										.	'</div>'
										.	( $row->get( 'description' ) ? '<div class="galleryFolderDescription well well-sm">' . htmlspecialchars( $row->get( 'description' ) ) . '</div>' : null );

		return $return;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:96,代码来源:folder.php

示例4: getconsultations

	/**
	 * @param  int[]             $paging
	 * @param  string            $where
	 * @param  UserTable         $viewer
	 * @param  UserTable         $user
	 * @param  PluginTable       $plugin
	 * @return cbconsultationsconsultationTable[]
	 */
	static public function getconsultations( $paging, $where, $viewer, $user, /** @noinspection PhpUnusedParameterInspection */ $plugin )
	{
		global $_CB_database;

		$categories		=	cbconsultationsModel::getCategoriesList( true );

		$consultations			=	array();

		if ( $categories ) {
			$query		=	'SELECT a.*'
						.	', a.' . $_CB_database->NameQuote( 'created_by' ) . ' AS user'
						.	', a.' . $_CB_database->NameQuote( 'introtext' ) . ' AS consultation_intro'
						.	', a.' . $_CB_database->NameQuote( 'fulltext' ) . ' AS consultation_full'
						.	', b.' . $_CB_database->NameQuote( 'name' ) . ' AS category'
						.	', b.' . $_CB_database->NameQuote( 'published' ) . ' AS category_published'
						.	', b.' . $_CB_database->NameQuote( 'alias' ) . ' AS category_alias'
						.	"\n FROM " . $_CB_database->NameQuote( '#__k2_items' ) . " AS a"
						.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__k2_categories' ) . " AS b"
						.	' ON b.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'catid' )
						.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__users' ) . " AS c"
						.	' ON c.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'created_by' )
						.	"\n WHERE a." . $_CB_database->NameQuote( 'catid' ) . " IN ( " . implode( ',', $categories ) . " )"
						.	"\n AND a." . $_CB_database->NameQuote( 'created_by' ) . " = " . (int) $user->get( 'id' )
						.	( ( $viewer->get( 'id' ) != $user->get( 'id' ) ) && ( ! Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator() ) ? "\n AND a." . $_CB_database->NameQuote( 'published' ) . " = 1" : null )
						.	"\n AND a." . $_CB_database->NameQuote( 'access' ) . " IN " . $_CB_database->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() )
						.	$where
						.	"\n ORDER BY a." . $_CB_database->NameQuote( 'created' ) . " DESC";

			if ( $paging ) {
				$_CB_database->setQuery( $query, $paging[0], $paging[1] );
			} else {
				$_CB_database->setQuery( $query );
			}

			$consultations		=	$_CB_database->loadObjectList( null, 'cbconsultationsconsultationTable', array( $_CB_database ) );
		}

		return $consultations;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:47,代码来源:k2.php

示例5: showTab

	/**
	 * @param cbinvitesInviteTable[] $rows
	 * @param cbPageNav              $pageNav
	 * @param bool                   $searching
	 * @param array                  $input
	 * @param UserTable              $viewer
	 * @param UserTable              $user
	 * @param TabTable               $tab
	 * @param cbTabHandler           $plugin
	 * @return string
	 */
	static function showTab( $rows, $pageNav, $searching, $input, $viewer, $user, $tab, $plugin )
	{
		global $_CB_framework, $_CB_database;

		$params						=	new Registry( $tab->params );
		$profileOwner				=	( $viewer->get( 'id' ) == $user->get( 'id' ) );
		$cbModerator				=	Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator();

		$tabPaging					=	$params->get( 'tab_paging', 1 );
		$canSearch					=	( $params->get( 'tab_search', 1 ) && ( $searching || $pageNav->total ) );

		$inviteLimit				=	(int) $plugin->params->get( 'invite_limit', null );
		$canCreate					=	false;
                
                $user_groups_can_create = array(12,16); //proizvoditeli, komercheskie organizacii
                $gids = $user->get('gids');

		if ( $profileOwner ) {
			if ( $cbModerator ) {
				$canCreate			=	true;
			} elseif ( $user->get( 'id' )   ) {
				if ( $inviteLimit ) {
					$query			=	'SELECT COUNT(*)'
									.	"\n FROM " . $_CB_database->NameQuote( '#__comprofiler_plugin_invites' )
									.	"\n WHERE " . $_CB_database->NameQuote( 'user_id' ) . " = " . (int) $user->get( 'id' )
									.	"\n AND ( " . $_CB_database->NameQuote( 'user' ) . " IS NULL OR " . $_CB_database->NameQuote( 'user' ) . " = " . $_CB_database->Quote( '' ) . " )";
					$_CB_database->setQuery( $query );
					$inviteCount	=	(int) $_CB_database->loadResult();

					if ( $inviteCount < $inviteLimit ) {
						$canCreate	=	true;
					}
				} else {
					$canCreate		=	true;
				}
			}
		}
                $groupcancreate = false;
                if($gids){
                    foreach($gids as $gid){
                        if(in_array($gid, $user_groups_can_create)){
                            $groupcancreate = true;
                        }
                    }
                    
                }
                
                if(!$groupcancreate){
                    $canCreate = false;
                }

		$return						=	'<div class="medizdTab">'
									.		'<form action="' . $_CB_framework->userProfileUrl( $user->get( 'id' ), true, $tab->tabid ) . '" method="post" name="medizdForm" id="inviteForm" class="medizdForm">';

		if ( $canCreate || $canSearch ) {
			$return					.=			'<div class="medizdHeader row" style="margin-bottom: 10px;">';

			if ( $canCreate ) {
				$return				.=				'<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
									.					'<button type="button" onclick="location.href=\'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'medizd', 'func' => 'new' ) ) . '\';" class="invitesButton invitesButtonNew btn btn-success"><span class="fa fa-plus-circle"></span> ' . CBTxt::T( 'MEDPR_NEW_PRODUCT' ) . '</button>'
									.				'</div>';
			}

			if ( $canSearch ) {
				$return				.=				'<div class="' . ( ! $canCreate ? 'col-sm-offset-8 ' : null ) . 'col-sm-4 text-right">'
									.					'<div class="input-group">'
									.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
									.						$input['search']
									.					'</div>'
									.				'</div>';
			}

			$return					.=			'</div>';
		}

		$menuAccess					=	( $cbModerator || $profileOwner );

		

		$return						.=			'<table class="invitesContainer table table-hover table-responsive">'
									.				'<thead>'
									.					'<tr>'
									.						'<th class="text-left">' . CBTxt::T( 'MEDPR_CODE' ) . '</th>'
									.						'<th style="width: 25%;" class="text-left hidden-xs">' . CBTxt::T( 'Name' ) . '</th>'
									.						'<th style="width: 5%;" class="text-center hidden-xs">' . CBTxt::T( 'Date' ) . '</th>'
                                                                        .                                               '<th style="width: 1%;" class="text-left hidden-xs"></th>'
									.					'</tr>'
									.				'</thead>'
									.				'<tbody>';
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:tab.php

示例6: showPreparatyTab

	/**
	 * Renders the Articles tab
	 *
	 * @param  Table[]      $rows       Articles to render
	 * @param  cbPageNav    $pageNav    Pagination
	 * @param  boolean      $searching  Currently searching
	 * @param  string[]     $input      HTML of input elements
	 * @param  UserTable    $viewer     Viewing user
	 * @param  UserTable    $user       Viewed user
	 * @param  stdClass     $model      The model reference
	 * @param  TabTable     $tab        Current Tab
	 * @param  PluginTable  $plugin     Current Plugin
	 * @return string                   HTML
	 */
	static public function showPreparatyTab( $rows, $pageNav, $searching, $input, $viewer, $user, /** @noinspection PhpUnusedParameterInspection */ $model, $tab, /** @noinspection PhpUnusedParameterInspection */ $plugin )
	{
		global $_CB_framework, $_LANG;
                
                $app =& JFactory::getApplication();
                $menu       = $app->getMenu();
                $active = $menu->getActive();
                $Itemid = $active->id;
                
		$tabPaging				=	$tab->params->get( 'tab_paging', 1 );
		$canSearch				=	( $tab->params->get( 'tab_search', 1 ) && ( $searching || $pageNav->total ) );
                $canCreate					=	false;
		$profileOwner				=	( $viewer->get( 'id' ) == $user->get( 'id' ) );
		$cbModerator				=	Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator();
		//$canPublish					=	( $cbModerator || ( $profileOwner && ( ! $plugin->params->get( 'hangout_approval', 0 ) ) ) );

		if ( $profileOwner ) {
			if ( $cbModerator ) {
				$canCreate			=	true;
			} elseif ( $user->get( 'id' ) && Application::User( (int) $viewer->get( 'id' ) )->canViewAccessLevel( (int) $plugin->params->get( 'hangout_create_access', 2 ) ) ) {
				if ( ( ! $blogLimit ) || ( $blogLimit && ( $pageNav->total < $blogLimit ) ) ) {
					$canCreate		=	true;
				}
			}
		}
                
		$return					=	'<div class="articlesTab">'
								.		'<form action="' . $_CB_framework->userProfileUrl( $user->id, true, $tab->tabid ) . '" method="post" name="articleForm" id="articleForm" class="articleForm">';
                
                if ( $canCreate ) {
				$return				.=				'<div class="' . ( ! $canSearch ? 'col-sm-12' : 'col-sm-8' ) . ' text-left">'
									.					'<button type="button" onclick="location.href=\'' . ($_CB_framework->getCfg( 'live_site' ).'/index.php?option=com_flexicontent&view=item&typeid=2&task=add&Itemid='.$Itemid) . '\';" class="blogsButton blogsButtonNew btn btn-success"><span class="fa fa-plus-circle"></span> ' . $_LANG['New Preparat'] . '</button>'
									.				'</div>';
			}
                        
		if ( $canSearch ) {
			$return				.=			'<div class="articlesHeader row" style="margin-bottom: 10px;">'
								.				'<div class="col-sm-offset-8 col-sm-4 text-right">'
								.					'<div class="input-group">'
								.						'<span class="input-group-addon"><span class="fa fa-search"></span></span>'
								.						$input['search']
								.					'</div>'
								.				'</div>'
								.			'</div>';
		}

		$return					.=			'<table class="articlesContainer table table-hover table-responsive">'
								.				'<thead>'
								.					'<tr>'
								.						'<th style="width: 50%;" class="text-left">' . $_LANG['Preparat'] . '</th>'
								.						'<th style="width: 25%;" class="text-left hidden-xs">' . CBTxt::T( 'Category' ) . '</th>'
								.						'<th style="width: 25%;" class="text-left hidden-xs">' . CBTxt::T( 'Created' ) . '</th>'
                                                                .                                               '<th style="width: 1%;" class="text-left hidden-xs"></th>'
								.					'</tr>'
								.				'</thead>'
								.				'<tbody>';
                
		
               $attribs = '';
			$image = FLEXI_J16GE ?
				JHTML::image(FLEXI_ICONPATH.'edit.png', JText::_( 'FLEXI_EDIT' ), $attribs) :
				JHTML::_('image.site', 'edit.png', FLEXI_ICONPATH, NULL, NULL, JText::_( 'FLEXI_EDIT' ), $attribs) ;
                
		if ( $rows ) foreach ( $rows as $row ) {
                    $item_url = cbpreparatyModel::getUrl( $row, true, 'article' , $Itemid);
                    //$item_url_edit = cbpreparatyModel::getUrl( $row, true, 'article' , 445);
                    $link = $_CB_framework->getCfg( 'live_site' ). '/' .$item_url  .(strstr($item_url, '?') ? '&' : '?').  'task=edit';
                    $edit_row	= $profileOwner ? '<a href="'.$link.'">'.$image.'</a>&nbsp;' : '';
                
			$return				.=					'<tr>'
								.						'<td style="width: 50%;" class="text-left">'.$edit_row.'<a href="' . cbpreparatyModel::getUrl( $row, true, 'article' ) . '">' . $row->get( 'title' ) . '</a></td>'
								.						'<td style="width: 25%;" class="text-left hidden-xs">' . ( $row->get( 'category' ) ? $row->get( 'category_title' ) : CBTxt::T( 'None' ) ) . '</td>'
								.						'<td style="width: 25%;" class="text-left hidden-xs">' . cbFormatDate( $row->get( 'created' ) ) . '</td>';
                        if ( ( $cbModerator || $profileOwner )    ) {
				$menuItems			=	'<ul class="invitesMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">';


				
					$menuItems		.=		'<li class="invitesMenuItem"><a href="' . $link . '"><span class="fa fa-edit"></span> ' . CBTxt::T( 'Edit' ) . '</a></li>'
									.		'<li class="invitesMenuItem"><a href="javascript: void(0);" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to delete this Drug?' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->pluginClassUrl( $plugin->element, false, array( 'action' => 'preparaty', 'func' => 'delete', 'id' => (int) $row->get( 'id' ) ) ) . '\'; }"><span class="fa fa-trash-o"></span> ' . CBTxt::T( 'Delete' ) . '</a></li>';
				

				$menuItems			.=	'</ul>';

				$menuAttr			=	cbTooltip( 1, $menuItems, null, 'auto', null, null, null, 'class="btn btn-default btn-xs" data-cbtooltip-menu="true" data-cbtooltip-classes="qtip-nostyle"' );

//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:tab.php

示例7: prepareStatus

 /**
  * @param  \CB\Database\Table\UserTable  $user
  */
 public function prepareStatus($user)
 {
     global $_CB_framework;
     $this->ui = $_CB_framework->getUi();
     $this->cbUserIsModerator = Application::User((int) $user->id)->isGlobalModerator();
     $this->cbMyIsModerator = Application::MyUser()->isModeratorFor(Application::User((int) $user->id));
     $params = $this->params;
     switch ($params->get('statusFormat', 'menuList')) {
         case 'menuBar':
             $this->menuList = new cbMenuBar(1);
             break;
         case 'menuUL':
             $this->menuList = new cbMenuUL(1);
             break;
         case 'menuDivs':
             $this->menuList = new cbMenuDivs(1);
             break;
         case 'menuList':
         default:
             $this->menuList = new cbMenuList(1);
             break;
     }
     $this->menuList->outputScripts(1);
 }
开发者ID:bobozhangshao,项目名称:HeartCare,代码行数:27,代码来源:cb.menu.php

示例8: sendNotification

 /**
  * Sends a PM notification
  *
  * @param cbmypmsproTable $pm
  * @param null|string     $message
  */
 private function sendNotification($pm, $message = null)
 {
     if (!$pm->get('id')) {
         return;
     }
     $itemId = uddeIMgetItemid($this->uddeIMConfigRAW);
     if (!uddeIMexistsEMN($pm->get('toid'))) {
         uddeIMinsertEMNdefaults($pm->get('toid'), $this->uddeIMConfigRAW);
     }
     $emailNotify = $this->uddeIMConfig->get('allowemailnotify', 0);
     $isModerated = uddeIMgetEMNmoderated($pm->get('fromid'));
     $isReply = stristr($pm->get('message'), $this->uddeIMConfig->get('quotedivider'), '__________');
     $isOnline = uddeIMisOnline($pm->get('toid'));
     // Strip the html and bbcode as uddeim supports neither in its notification:
     $message = strip_tags(uddeIMbbcode_strip($message ? $message : $pm->get('message'), $this->uddeIMConfigRAW));
     if (!$isModerated) {
         if ($emailNotify == 1 || $emailNotify == 2 && Application::User($pm->get('toid'))->isSuperAdmin()) {
             $status = uddeIMgetEMNstatus($pm->get('toid'));
             if ($status == 1 || $status == 2 && !$isOnline || $status == 10 && !$isReply || $status == 20 && !$isOnline && !$isReply) {
                 uddeIMdispatchEMN($pm->get('id'), $itemId, 0, $pm->get('fromid'), $pm->get('toid'), $message, 0, $this->uddeIMConfigRAW);
             }
         }
     }
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:30,代码来源:pms.mypmspro.php

示例9: getBlogs

	/**
	 * @param  int[]             $paging
	 * @param  string            $where
	 * @param  UserTable         $viewer
	 * @param  UserTable         $user
	 * @param  PluginTable       $plugin
	 * @return cbblogsBlogTable[]
	 */
	static public function getBlogs( $paging, $where, $viewer, $user, $plugin )
	{
		global $_CB_database;

		$section	=	$plugin->params->get( 'blog_j_section', null );

		$query		=	'SELECT a.*'
					.	', a.' . $_CB_database->NameQuote( 'created_by' ) . ' AS user'
					.	', a.' . $_CB_database->NameQuote( 'introtext' ) . ' AS blog_intro'
					.	', a.' . $_CB_database->NameQuote( 'fulltext' ) . ' AS blog_full'
					.	', a.' . $_CB_database->NameQuote( 'state' ) . ' AS published'
					.	', b.' . $_CB_database->NameQuote( 'title' ) . ' AS category'
					.	', b.' . $_CB_database->NameQuote( 'published' ) . ' AS category_published'
					.	', b.' . $_CB_database->NameQuote( 'alias' ) . ' AS category_alias'
					.	"\n FROM " . $_CB_database->NameQuote( '#__content' ) . " AS a"
					.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__categories' ) . " AS b"
					.	' ON b.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'catid' )
					.	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__users' ) . " AS c"
					.	' ON c.' . $_CB_database->NameQuote( 'id' ) . ' = a.' . $_CB_database->NameQuote( 'created_by' );

		if ( $section ) {
			$query	.=	"\n LEFT JOIN " . $_CB_database->NameQuote( '#__categories' ) . " AS d"
					.	' ON d.' . $_CB_database->NameQuote( 'id' ) . ' = ' . (int) $section;
		}

		$query		.=	"\n WHERE b." . $_CB_database->NameQuote( 'extension' ) . " = " . $_CB_database->Quote( 'com_content' );

		if ( $section ) {
			$query	.=	"\n AND b." . $_CB_database->NameQuote( 'lft' ) . " BETWEEN ( d." . $_CB_database->NameQuote( 'lft' ) . " + 1 ) AND ( d." . $_CB_database->NameQuote( 'rgt' ) . " - 1 )"
					.	"\n AND d." . $_CB_database->NameQuote( 'extension' ) . " = " . $_CB_database->Quote( 'com_content' );
		}

		$query		.=	"\n AND a." . $_CB_database->NameQuote( 'created_by' ) . " = " . (int) $user->get( 'id' )
					.	( ( $viewer->get( 'id' ) != $user->get( 'id' ) ) && ( ! Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator() ) ? "\n AND a." . $_CB_database->NameQuote( 'state' ) . " = 1" : null )
					.	"\n AND a." . $_CB_database->NameQuote( 'access' ) . " IN " . $_CB_database->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() )
					.	"\n AND b." . $_CB_database->NameQuote( 'published' ) . " = 1"
					.	"\n AND b." . $_CB_database->NameQuote( 'access' ) . " IN " . $_CB_database->safeArrayOfIntegers( Application::MyUser()->getAuthorisedViewLevels() )
					.	$where
					.	"\n ORDER BY a." . $_CB_database->NameQuote( 'created' ) . " DESC";

		if ( $paging ) {
			$_CB_database->setQuery( $query, $paging[0], $paging[1] );
		} else {
			$_CB_database->setQuery( $query );
		}

		return $_CB_database->loadObjectList( null, 'cbblogsBlogTable', array( $_CB_database ) );
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:56,代码来源:joomla25.php

示例10: deleteMedizd

	/**
	 * @param int       $id
	 * @param UserTable $user
	 */
	private function deleteMedizd( $id, $user )
	{
		global $_CB_framework;

		$cbModerator			=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();

		$row					=	new cbmedizdProductTable();

		$row->load( (int) $id );

		$canAccess				=	false;

		if ( $row->get( 'id' ) && ( $cbModerator || ( $row->get( 'user_id' ) == $user->get( 'id' ) ) ) ) {
			$canAccess			=	true;
		}

		$profileUrl				=	$_CB_framework->userProfileUrl( $row->get( 'user_id', $user->get( 'id' ) ), false, 'cbmedizdTab' );

		if ( $canAccess ) {
			
			if ( ! $row->delete() ) {
				cbRedirect( $profileUrl, CBTxt::T( 'FAILED_DELETE_ERROR', 'Failed to delete! Error: [error]', array( '[error]' => $row->getError() ) ), 'error' );
			}

			cbRedirect( $profileUrl, CBTxt::T( 'MEDPR_PROD_DELSUCC' ) );
		} else {
			cbRedirect( $profileUrl, CBTxt::T( 'Not authorized.' ), 'error' );
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:33,代码来源:component.cbmedizd.php

示例11: showBlogEdit

	/**
	 * @param  OrderedTable  $row
	 * @param  string[]      $input
	 * @param  UserTable     $user
	 * @param  stdClass      $model
	 * @param  PluginTable   $plugin
	 */
	static function showBlogEdit( $row, $input, $user, /** @noinspection PhpUnusedParameterInspection */ $model, $plugin )
	{
		global $_CB_framework, $_PLUGINS, $_LANG;

		cbValidator::loadValidation();

		$blogMode			=	$plugin->params->get( 'hangout_mode', 1 );
		$pageTitle			=	( $row->get( 'id' ) ? $_LANG['Edit Hangout'] : $_LANG['Create Hangout'] );
		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( $_LANG['Hangout'] ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbhangoutTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'hangout', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'hangout', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="blogEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'hangout', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="blogForm" id="blogForm" class="cb_form blogForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="blogsTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null );

		if ( $cbModerator || ( ! $plugin->params->get( 'hangout_approval', 0 ) ) ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="published" class="col-sm-3 control-label">' . CBTxt::Th( 'Published' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['published']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'hangout_category_config', 1 ) || $cbModerator ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="category" class="col-sm-3 control-label">' . CBTxt::Th( 'Category' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['category']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'hangout_access_config', 1 ) || $cbModerator ) {
			$return			.=			'<div class="cbft_select cbtt_select form-group cb_form_line clearfix">'
							.				'<label for="access" class="col-sm-3 control-label">' . CBTxt::Th( 'Access' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['access']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		$return				.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="title" class="col-sm-3 control-label">' . CBTxt::Th( 'Title' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['title']
							.					getFieldIcons( 1, 1, null, '' )
							.				'</div>'
							.			'</div>';

		if ( in_array( $blogMode, array( 1, 2 ) ) ) {
			$return			.=			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="hangout_intro" class="col-sm-3 control-label">' . ( $blogMode == 1 ? $_LANG['Text intro'] : $_LANG['Text intro'] ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['hangout_intro']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
		}

		if ( in_array( $blogMode, array( 1, 3 ) ) ) {
			$return			.=			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="hangout_full" class="col-sm-3 control-label">' . ( $blogMode == 1 ? $_LANG['Text full'] : $_LANG['Text full'] ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['hangout_full']
							.					getFieldIcons( 1, 0, null, '' )
							.				'</div>'
							.			'</div>';
                        
                        $return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="title" class="col-sm-3 control-label">' . $_LANG['Price'] . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['price']
							.					getFieldIcons( 1, 0, null, $_LANG['Input price']  )
							.				'</div>'
							.			'</div>';
                        
		}

		if ( $cbModerator ) {
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user']
							.					getFieldIcons( 1, 1, null, '' )
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:blog_edit.php

示例12: showProductEdit

	/**
	 * @param cbinvitesInviteTable $row
	 * @param array                $input
	 * @param UserTable            $user
	 * @param cbPluginHandler      $plugin
	 */
	static function showProductEdit( $row, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		cbValidator::loadValidation();

		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
		$pageTitle			=	( $row->get( 'id' ) ? CBTxt::T( 'MEDPR_EDIT_PRODUCT' ) : CBTxt::T( 'MEDPR_CREATE_PRODUCT' ) );

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'MEDPR_MEDICINE_PRODUCT' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbinvitesTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'medizd', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'medizd', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="medizdEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'medizd', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="medizdForm" id="medizdForm" class="cb_form medizdForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="invitesTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="to" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_CODE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['code']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="subject" class="col-sm-3 control-label">' . CBTxt::T( 'Name' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['name']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="body" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_DESCRIPTION' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['description']
							.					getFieldIcons( 1, 0, null )
							.				'</div>'
							.			'</div>';

		
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Category' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['category']
							.					getFieldIcons( 1, 1, null)
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_MANUFACTURE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['proizvoditel']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>'
                                                        .   '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_COUNTRY' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['country']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>'
                                                        .   '<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'MEDPR_PRICE' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['price']
							.					getFieldIcons( 1, 0, null)
							.				'</div>'
							.			'</div>';
		

		

		$return				.=			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="col-sm-offset-3 col-sm-9">'
							.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'MEDPR_UPDATE_PRODUCT' ) : CBTxt::T( 'MEDPR_SAVE_PRODUCT' ) ) ) . '" class="invitesButton invitesButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
							.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="invitesButton invitesButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbmedizdFormTab' ) . '\'; }" />'
							.				'</div>'
							.			'</div>'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:91,代码来源:medizd_edit.php

示例13: showInviteEdit

	/**
	 * @param cbinvitesInviteTable $row
	 * @param array                $input
	 * @param UserTable            $user
	 * @param cbPluginHandler      $plugin
	 */
	static function showInviteEdit( $row, $input, $user, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		cbValidator::loadValidation();

		$cbModerator		=	Application::User( (int) $user->get( 'id' ) )->isGlobalModerator();
		$pageTitle			=	( $row->get( 'to' ) ? CBTxt::T( 'Edit Invite' ) : CBTxt::T( 'Create Invite' ) );

		$_CB_framework->setPageTitle( $pageTitle );
		$_CB_framework->appendPathWay( htmlspecialchars( CBTxt::T( 'Invites' ) ), $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), true, 'cbinvitesTab' ) );
		$_CB_framework->appendPathWay( htmlspecialchars( $pageTitle ), $_CB_framework->pluginClassUrl( $plugin->element, true, ( $row->get( 'id' ) ? array( 'action' => 'invites', 'func' => 'edit', 'id' => (int) $row->get( 'id' ) ) : array( 'action' => 'invites', 'func' => 'new' ) ) ) );

		initToolTip();

		$return				=	'<div class="invitesEdit">'
							.		'<form action="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'invites', 'func' => 'save', 'id' => (int) $row->get( 'id' ) ) ) . '" method="post" enctype="multipart/form-data" name="invitesForm" id="invitesForm" class="cb_form invitesForm form-auto cbValidation">'
							.			( $pageTitle ? '<div class="invitesTitle page-header"><h3>' . $pageTitle . '</h3></div>' : null )
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="to" class="col-sm-3 control-label">' . CBTxt::T( 'To' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['to']
							.					getFieldIcons( 1, 1, null, ( $plugin->params->get( 'invite_multiple', 1 ) ? CBTxt::T( 'Input invite email to address. Separate multiple email addresses with a comma.' ) : CBTxt::T( 'Input invite email to address.' ) ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="subject" class="col-sm-3 control-label">' . CBTxt::T( 'Subject' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['subject']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Input invite email subject; if left blank a subject will be applied.' ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_textarea cbtt_textarea form-group cb_form_line clearfix">'
							.				'<label for="body" class="col-sm-3 control-label">' . CBTxt::T( 'Body' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['body']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input private message to include with invite email.' ) )
							.				'</div>'
							.			'</div>';

		if ( $cbModerator ) {
			$return			.=			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user_id" class="col-sm-3 control-label">' . CBTxt::T( 'Owner' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user_id']
							.					getFieldIcons( 1, 1, null, CBTxt::T( 'Input owner of invite as single integer user_id. This is the user who sent the invite.' ) )
							.				'</div>'
							.			'</div>'
							.			'<div class="cbft_text cbtt_input form-group cb_form_line clearfix">'
							.				'<label for="user" class="col-sm-3 control-label">' . CBTxt::T( 'User' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					$input['user']
							.					getFieldIcons( 1, 0, null, CBTxt::T( 'Optionally input user of invite as single integer user_id. This is the user who accepted the invite.' ) )
							.				'</div>'
							.			'</div>';
		}

		if ( $plugin->params->get( 'invite_captcha', 0 ) && ( ! $cbModerator ) ) {
			$_PLUGINS->loadPluginGroup( 'user' );

			$captcha		=	$_PLUGINS->trigger( 'onGetCaptchaHtmlElements', array( false ) );

			if ( ! empty( $captcha ) ) {
				$captcha	=	$captcha[0];

				$return		.=			'<div class="form-group cb_form_line clearfix">'
							.				'<label class="col-sm-3 control-label">' . CBTxt::Th( 'Captcha' ) . '</label>'
							.				'<div class="cb_field col-sm-9">'
							.					( isset( $captcha[0] ) ? $captcha[0] : null )
							.				'</div>'
							.			'</div>'
							.			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="cb_field col-sm-offset-3 col-sm-9">'
							.					str_replace( 'inputbox', 'form-control', ( isset( $captcha[1] ) ? $captcha[1] : null ) )
							.					getFieldIcons( 1, 1, null )
							.				'</div>'
							.			'</div>';
			}
		}

		$return				.=			'<div class="form-group cb_form_line clearfix">'
							.				'<div class="col-sm-offset-3 col-sm-9">'
							.					'<input type="submit" value="' . htmlspecialchars( ( $row->get( 'id' ) ? CBTxt::T( 'Update Invite' ) : CBTxt::T( 'Send Invite' ) ) ) . '" class="invitesButton invitesButtonSubmit btn btn-primary"' . cbValidator::getSubmitBtnHtmlAttributes() . ' />&nbsp;'
							.					' <input type="button" value="' . htmlspecialchars( CBTxt::T( 'Cancel' ) ) . '" class="invitesButton invitesButtonCancel btn btn-default" onclick="if ( confirm( \'' . addslashes( CBTxt::T( 'Are you sure you want to cancel? All unsaved data will be lost!' ) ) . '\' ) ) { location.href = \'' . $_CB_framework->userProfileUrl( $row->get( 'user', $user->get( 'id' ) ), false, 'cbinvitesTab' ) . '\'; }" />'
							.				'</div>'
							.			'</div>'
							.			cbGetSpoofInputTag( 'plugin' )
							.		'</form>'
							.	'</div>';

		echo $return;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:98,代码来源:invite_edit.php

示例14: userProfile

 static function userProfile($user, $option, $submitvalue)
 {
     global $_CB_framework, $ueConfig, $_POST, $_PLUGINS;
     $_PLUGINS->loadPluginGroup('user');
     $_PLUGINS->trigger('onBeforeUserProfileRequest', array(&$user, 1));
     if ($_PLUGINS->is_errors()) {
         echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
         exit;
     }
     $cbTemplate = HTML_comprofiler::_cbTemplateLoad();
     $cbMyIsModerator = Application::MyUser()->isModeratorFor(Application::User((int) $user->id));
     $cbUserIsModerator = Application::User((int) $user->id)->isGlobalModerator();
     $showProfile = 1;
     if ($user->banned != 0 || $user->block == 1 && $user->confirmed && $user->approved) {
         if ($user->banned != 0) {
             if ($_CB_framework->myId() != $user->id) {
                 $_CB_framework->enqueueMessage(CBTxt::T('UE_USERPROFILEBANNED', 'This profile has been banned by a moderator.') . ($user->bannedreason && $cbMyIsModerator ? '<p>' . nl2br($user->bannedreason) . '</p>' : null), 'error');
             } else {
                 $_CB_framework->enqueueMessage(CBTxt::T('UE_BANNED_CHANGE_PROFILE', 'Your Profile is banned. Only you and moderators can see it.<br />Please follow the request of the moderator, then choose moderation / unban to submit a request for unbanning your profile.') . ($user->bannedreason ? '<p>' . nl2br($user->bannedreason) . '</p>' : null), 'error');
             }
         }
         if ($user->block == 1) {
             $_CB_framework->enqueueMessage(CBTxt::T('UE_USERPROFILEBLOCKED', 'This profile is no longer available.'), 'error');
         }
         if ($_CB_framework->myId() != $user->id && $cbMyIsModerator != 1) {
             $showProfile = 0;
         }
     }
     if (!$user->confirmed) {
         $_CB_framework->enqueueMessage(CBTxt::T('UE_USER_NOT_CONFIRMED', 'This user has not yet confirmed his email address and account!'), 'error');
     }
     if (!$user->approved) {
         $_CB_framework->enqueueMessage(CBTxt::T('UE_USER_NOT_APPROVED', 'This user has not yet been approved by a moderator!'), 'error');
     }
     if ((!$user->confirmed || !$user->approved) && $cbMyIsModerator != 1) {
         $showProfile = 0;
     }
     if ($showProfile == 1) {
         $results = $_PLUGINS->trigger('onBeforeUserProfileDisplay', array(&$user, 1, $cbUserIsModerator, $cbMyIsModerator));
         if ($_PLUGINS->is_errors()) {
             echo "<script type=\"text/javascript\">alert(\"" . $_PLUGINS->getErrorMSG() . "\"); window.history.go(-1); </script>\n";
             exit;
         }
         $output = 'html';
         $cbUser =& CBuser::getInstance($user->id);
         $_CB_framework->displayedUser((int) $user->id);
         $userViewTabs = $cbUser->getProfileView();
         $_CB_framework->setPageTitle(cbUnHtmlspecialchars(getNameFormat($user->name, $user->username, $ueConfig['name_format'])));
         $_CB_framework->appendPathWay(getNameFormat($user->name, $user->username, $ueConfig['name_format']));
         outputCbTemplate(1);
         initToolTip(1);
         $pageClass = $_CB_framework->getMenuPageClass();
         $return = '<div class="cbProfile cb_template cb_template_' . selectTemplate('dir') . ($pageClass ? ' ' . htmlspecialchars($pageClass) : null) . '">';
         if (is_array($results)) {
             $return .= implode('', $results);
         }
         $return .= $_PLUGINS->callTemplate($cbTemplate, 'Profile', 'drawProfile', array(&$user, &$userViewTabs), $output) . '</div>' . cbPoweredBy();
         echo $return;
         if ($_CB_framework->myId() != $user->id) {
             recordViewHit($_CB_framework->myId(), $user->id, getenv('REMOTE_ADDR'));
         }
         $_PLUGINS->trigger('onAfterUserProfileDisplay', array($user, true));
         $_CB_framework->setMenuMeta();
     }
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:65,代码来源:comprofiler.html.php

示例15: showFolders

	/**
	 * @param cbgalleryFolderTable[] $rows
	 * @param cbPageNav              $pageNav
	 * @param int                    $uncategorized
	 * @param string                 $type
	 * @param UserTable              $viewer
	 * @param UserTable              $user
	 * @param TabTable               $tab
	 * @param cbTabHandler           $plugin
	 * @return string
	 */
	static public function showFolders( $rows, $pageNav, $uncategorized, $type, $viewer, $user, $tab, $plugin )
	{
		global $_CB_framework, $_PLUGINS;

		$_PLUGINS->trigger( 'gallery_onBeforeDisplayFolders', array( &$rows, $pageNav, $uncategorized, $type, $viewer, $user, $tab, $plugin ) );

		switch( $type ) {
			case 'photos':
				$galleryType			=	CBTxt::T( 'Photos' );
				break;
			case 'files':
				$galleryType			=	CBTxt::T( 'Files' );
				break;
			case 'videos':
				$galleryType			=	CBTxt::T( 'Videos' );
				break;
			case 'music':
				$galleryType			=	CBTxt::T( 'Music' );
				break;
			default:
				$galleryType			=	CBTxt::T( 'Items' );
				break;
		}

		switch( $type ) {
			case 'photos':
			case 'videos':
			case 'music':
				$typeTranslated			=	CBTxt::T( 'Album' );
				break;
			default:
				$typeTranslated			=	CBTxt::T( 'Folder' );
				break;
		}

		/** @var Registry $params */
		$params							=	$tab->params;
		$profileOwner					=	( $viewer->get( 'id' ) == $user->get( 'id' ) );
		$cbModerator					=	Application::User( (int) $viewer->get( 'id' ) )->isGlobalModerator();

		$return							=			'<div class="' . htmlspecialchars( $type ) . 'FoldersContainer" style="margin-bottom: 10px;">';

		if ( $uncategorized ) {
			switch( $type ) {
				case 'photos':
					$count				=	CBTxt::T( 'FOLDER_PHOTOS_COUNT', '%%COUNT%% Photo|%%COUNT%% Photos', array( '%%COUNT%%' => $uncategorized ) );
					break;
				case 'files':
					$count				=	CBTxt::T( 'FOLDER_FILES_COUNT', '%%COUNT%% File|%%COUNT%% Files', array( '%%COUNT%%' => $uncategorized ) );
					break;
				case 'videos':
					$count				=	CBTxt::T( 'FOLDER_VIDEOS_COUNT', '%%COUNT%% Video|%%COUNT%% Videos', array( '%%COUNT%%' => $uncategorized ) );
					break;
				case 'music':
					$count				=	CBTxt::T( 'FOLDER_MUSIC_COUNT', '%%COUNT%% Music|%%COUNT%% Music', array( '%%COUNT%%' => $uncategorized ) );
					break;
				default:
					$count				=	CBTxt::T( 'FOLDER_ITEM_COUNT', '%%COUNT%% Item|%%COUNT%% Items', array( '%%COUNT%%' => $uncategorized ) );
					break;
			}

			$return						.=		'<div class="galleryContainer img-thumbnail">'
										.			'<div class="galleryContainerInner" style="height: 100px; width: 100px;">'
										.				'<div class="galleryContainerTop" style="height: 60px">'
										.					'<div class="galleryContainerContent">'
										.						( $uncategorized ? '<span class="galleryFoldersNotEmpty fa fa-folder-open-o"></span>' : '<span class="galleryFoldersEmpty fa fa-folder-o"></span>' )
										.					'</div>'
										.				'</div>'
										.				'<div class="galleryContainerBottom" style="height: 40px">'
										.					'<div class="galleryContainerContent">'
										.						'<div class="galleryContainerContentRow text-nowrap text-overflow small">'
										.							'<strong>'
										.								'<a href="' . $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'folders', 'func' => 'show', 'type' => $type, 'id' => 0, 'user' => (int) $user->get( 'id' ), 'tab' => (int) $tab->get( 'tabid' ) ) ) . '">'
										.									CBTxt::T( 'Uncategorized' )
										.								'</a>'
										.							'</strong>'
										.						'</div>'
										.						'<div class="galleryContainerContentRow text-nowrap text-overflow small">' . $count . '</div>'
										.					'</div>'
										.				'</div>'
										.			'</div>'
										.		'</div>';
		}

		if ( $rows ) foreach ( $rows as $row ) {
			$return						.=		'<div class="galleryContainer img-thumbnail">';

			if ( $cbModerator || $profileOwner ) {
				$menuItems				=	'<ul class="galleryFoldersMenuItems dropdown-menu" style="display: block; position: relative; margin: 0;">'
//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:folders.php


注:本文中的CBLib\Application\Application::User方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。