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


PHP JUDownloadHelper::getParams方法代码示例

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


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

示例1: display

	public function display($tpl = null)
	{
		$this->params = JUDownloadHelper::getParams();

		
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode("\n", $errors));

			return false;
		}

		if (!$this->params->get('activate_maintenance', 0))
		{
			$app = JFactory::getApplication();
			$app->redirect(JUri::root());
		}

		$this->_prepareDocument();

		$this->_setBreadcrumb();

		
		parent::display($tpl);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:25,代码来源:view.html.php

示例2: populateState

	protected function populateState($ordering = null, $direction = null)
	{
		
		$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search', '');
		$this->setState('filter.search', $search);

		$featured = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured', '');
		$this->setState('filter.featured', $featured);

		$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_catid', '');
		$this->setState('filter.catid', $categoryId);

		$license = $this->getUserStateFromRequest($this->context . '.filter.license', 'filter_licenseid', '');
		$this->setState('filter.licenseid', $license);

		
		$params = JUDownloadHelper::getParams();
		$this->setState('params', $params);

		
		parent::populateState('d.title', 'asc');

		$field_display = $this->getUserStateFromRequest($this->context . '.field_display', 'field_display', array());
		$this->setState('field_display', $field_display);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:25,代码来源:embeddocument.php

示例3: populateState

	protected function populateState($ordering = null, $direction = null)
	{
		
		$app = JFactory::getApplication();

		$catId  = $app->input->getInt('id', 1);
		$params = JUDownloadHelper::getParams($catId);
		$this->setState('params', $params);
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:9,代码来源:categories.php

示例4: canView

	public function canView($options = array())
	{
		$storeId = md5(__METHOD__ . "::" . $this->doc_id . "::" . $this->id . "::" . serialize($options));

		if (!isset(self::$cache[$storeId]))
		{
			if (!$this->isPublished())
			{
				self::$cache[$storeId] = false;

				return self::$cache[$storeId];
			}

			
			if (isset($this->doc) && $this->doc->cat_id)
			{
				$params = JUDownloadHelper::getParams($this->doc->cat_id);
			}
			else
			{
				$params = JUDownloadHelper::getParams(null, $this->doc_id);
			}

			$show_empty_field = $params->get('show_empty_field', 0);
			
			if ($this->doc_id && !$show_empty_field)
			{
				$app = JFactory::getApplication();
				if ($app->isSite())
				{
					if (!is_object($this->value) || !$this->value->published)
					{
						self::$cache[$storeId] = false;

						return self::$cache[$storeId];
					}
				}
				else
				{
					if (!is_object($this->value))
					{
						self::$cache[$storeId] = false;

						return self::$cache[$storeId];
					}
				}
			}

			self::$cache[$storeId] = parent::canView($options);

			return self::$cache[$storeId];
		}

		return self::$cache[$storeId];
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:55,代码来源:core_license.php

示例5: populateState

	protected function populateState($ordering = null, $direction = null)
	{
		
		$app = JFactory::getApplication();

		$rootCategory = JUDownloadFrontHelperCategory::getRootCategory();
		$categoryId   = $app->input->getInt('id', $rootCategory->id);

		$this->setState('category.id', $categoryId);

		$params = JUDownloadHelper::getParams($categoryId);
		$this->setState('params', $params);

		
		if ($this->context)
		{
			$documentPagination = $params->get('document_pagination', 10);

			$limitArray = JUDownloadFrontHelper::customLimitBox();

			if (is_array($limitArray) && count($limitArray))
			{
				$limit = $app->input->getUint('limit', null);
				if (is_null($limit) || in_array($limit, $limitArray))
				{
					$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $documentPagination, 'uint');
				}
				else
				{
					$limit = $documentPagination;
				}
			}
			else
			{
				$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $documentPagination, 'uint');
			}

			$this->setState('list.limit', $limit);

			$this->setState('list.start', $app->input->getUint('limitstart', 0));

			$orderCol = $app->getUserStateFromRequest($this->context . '.list.ordering', 'filter_order', '');
			$this->setState('list.ordering', $orderCol);

			$listOrder = $app->getUserStateFromRequest($this->context . '.list.direction', 'filter_order_Dir', 'ASC');
			$this->setState('list.direction', $listOrder);
		}
		else
		{
			$this->setState('list.start', 0);
			$this->state->set('list.limit', 0);
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:53,代码来源:featured.php

示例6: populateState

	public function populateState($ordering = null, $direction = null)
	{
		
		$app = JFactory::getApplication();

		$params = JUDownloadHelper::getParams();
		$this->setState('params', $params);

		
		if ($this->context)
		{
			$commentPagination = $params->get('comment_pagination', 10);

			$limitArray = JUDownloadFrontHelper::customLimitBox();

			if (is_array($limitArray) && count($limitArray))
			{
				$limit = $app->input->getUint('limit', null);
				if (is_null($limit) || in_array($limit, $limitArray))
				{
					$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $commentPagination, 'uint');
				}
				else
				{
					$limit = $commentPagination;
				}
			}
			else
			{
				$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $commentPagination, 'uint');
			}

			$this->setState('list.limit', $limit);

			$this->setState('list.start', $app->input->get('limitstart', 0, 'uint'));

			$commentOrdering = $params->get('comment_ordering', 'cm.created');
			$orderCol        = $app->getUserStateFromRequest($this->context . '.list.ordering', 'filter_order', $commentOrdering);
			$this->setState('list.ordering', $orderCol);

			$commentDirection = $params->get('comment_direction', 'DESC');
			$listOrder        = $app->getUserStateFromRequest($this->context . '.list.direction', 'filter_order_Dir', $commentDirection);
			$this->setState('list.direction', $listOrder);
		}
		else
		{
			$this->setState('list.start', 0);
			$this->state->set('list.limit', 0);
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:50,代码来源:topcomments.php

示例7: getDefaultAvatar

	public static function getDefaultAvatar($params = null)
	{
		if (!$params)
		{
			$params = JUDownloadHelper::getParams();
		}

		$linkAvatar    = JUri::root(true) . "/" . JUDownloadFrontHelper::getDirectory("avatar_directory", "media/com_judownload/images/avatar/", true) . "default/" . $params->get('default_avatar', 'default-avatar.png');
		$avatar_source = $params->get('avatar_source', 'juavatar');
		if ($avatar_source == 'gavatar')
		{
			$linkAvatar = self::getGAvatar();
		}

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

示例8: getInput

 protected function getInput()
 {
     $params = JUDownloadHelper::getParams();
     $max_upload = ini_get('upload_max_filesize');
     $src = JUri::root() . JUDownloadFrontHelper::getDirectory("collection_icon_directory", "media/com_judownload/images/collection/", true) . $this->value;
     $html = "<div class=\"avatar\" style=\"float: left;\">";
     if ($this->value) {
         $html .= "<div class=\"clearfix\"><img src=\"" . $src . "\" width=\"" . $params->get('collection_icon_width', 100) . "px\" height=\"" . $params->get('collection_icon_height', 100) . "px\" /></div>";
         $html .= "<label><input type=\"checkbox\" name=\"remove_icon\" value=\"1\" />&nbsp;" . JText::_('COM_JUDOWNLOAD_REMOVE_ICON') . "</label>";
     }
     $html .= "<div class=\"clearfix\"><input type=\"file\" name=\"collection_icon\"  id=\"" . $this->id . "\" />";
     $html .= "<input type=\"hidden\" name=\"" . $this->name . "\" value=\"" . $this->value . "\" /></div>";
     $html .= "<div class=\"clearfix\"><i>" . JText::_('COM_JUDOWNLOAD_MAX_UPLOAD_FILESIZE') . " <strong>" . JUDownloadHelper::formatBytes($this->convertBytes($max_upload)) . "</strong></i></div>";
     $html .= "</div>";
     return $html;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:16,代码来源:collectionicon.php

示例9: getCaptcha

	public static function getCaptcha($hiddenCaptcha = false, $captchaNameSpaceValue = null, $label = true, $name = "security_code", $id = "security_code", $captchaNameSpaceName = "captcha_namespace")
	{
		$document = JFactory::getDocument();
		$document->addScript(JUri::root(true) . "/components/com_judownload/assets/js/captcha.js");
		$params = JUDownloadHelper::getParams();

		$captchaNameSpaceValue = !$captchaNameSpaceValue ? md5(time()) : $captchaNameSpaceValue;

		$html = '';

		if ($label)
		{
			$html .= '<div class="control-group">';
			$html .= '<label class="control-label" for="' . $id . '">' . JText::_('COM_JUDOWNLOAD_CAPTCHA') . '<span class="required" style="color: red">*</span></label>';
			$html .= '<div class="controls">';
		}

		$html .= '<div class="judl-captcha pull-left">';
		$html .= '<div class="clearfix">';

		if ($hiddenCaptcha == false)
		{
			$html .= '<img class="captcha-image" alt="' . JText::_('COM_JUDOWNLOAD_CAPTCHA') . '"
							src="' . JUri::root(true) . '/index.php?option=com_judownload&task=captcha&captcha_namespace=' . $captchaNameSpaceValue . '&tmpl=component"
							width="' . $params->get('captcha_width', '155') . 'px"  height="' . $params->get('captcha_height', '50') . 'px"/>';
		}
		else
		{
			$html .= '<img class="captcha-image" alt="' . JText::_('COM_JUDOWNLOAD_CAPTCHA') . '"
							src="" width="' . $params->get('captcha_width', '155') . 'px"  height="' . $params->get('captcha_height', '50') . 'px"/>';
		}
		$html .= '<input type="hidden" class="captcha-namespace" name="' . $captchaNameSpaceName . '" value="' . $captchaNameSpaceValue . '" />';
		$html .= '</div>';
		$html .= '<div class="input-group input-group-sm">';
		$html .= '<input type="text" id="' . $id . '" name="' . $name . '" class="security_code form-control required" autocomplete="off"/>';
		$html .= '<span class="input-group-addon btn btn-default reload-captcha" title="' . JText::_('COM_JUDOWNLOAD_RELOAD_CAPTCHA') . '"><i class="fa fa-refresh" ></i></span>';
		$html .= '</div>';
		$html .= '</div>';

		if ($label)
		{
			$html .= '</div>';
			$html .= '</div>';
		}

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

示例10: display

 public function display($tpl = null)
 {
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->model = $this->getModel();
     $this->app = JFactory::getApplication();
     $cat_id = $this->item->cat_id ? $this->item->cat_id : $this->app->input->get('cat_id');
     $this->params = JUDownloadHelper::getParams(null, $this->item->id);
     if ($cat_id == JUDownloadFrontHelperCategory::getRootCategory()->id && !$this->params->get('allow_add_doc_to_root', 0)) {
         JError::raiseError(500, JText::_('COM_JUDOWNLOAD_CAN_NOT_ADD_DOCUMENT_TO_ROOT_CATEGORY'));
         return false;
     }
     if ($tempDocument = JUDownloadHelper::getTempDocument($this->item->id)) {
         $editPendingDocLink = '<a href="index.php?option=com_judownload&task=document.edit&approve=1&id=' . $tempDocument->id . '">' . $tempDocument->title . '</a>';
         JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_THIS_DOCUMENT_HAS_PENDING_DOCUMENT_X_PLEASE_APPROVE_PENDING_DOCUMENT_FIRST', $editPendingDocLink));
     }
     if ($this->item->approved < 0) {
         $oriDocId = abs($this->item->approved);
         $oriDocObj = JUDownloadHelper::getDocumentById($oriDocId);
         $editOriDocLink = '<a href="index.php?option=com_judownload&task=document.edit&id=' . $oriDocId . '">' . $oriDocObj->title . '</a>';
         JError::raiseNotice('', JText::sprintf('COM_JUDOWNLOAD_ORIGINAL_DOCUMENT_X', $editOriDocLink));
     }
     $this->script = $this->get('Script');
     $this->plugins = $this->get('Plugins');
     $this->fieldsetDetails = $this->model->getCoreFields('details');
     $this->fieldsetPublishing = $this->model->getCoreFields('publishing');
     $this->fieldsetTemplateStyleAndLayout = $this->model->getCoreFields('template_style');
     $this->fieldsetMetadata = $this->model->getCoreFields('metadata');
     $this->fieldCatid = JUDownloadFrontHelperField::getField('cat_id', $this->item);
     $this->fieldGallery = JUDownloadFrontHelperField::getField('gallery', $this->item);
     $this->files = $this->get('Files');
     $this->changeLogs = $this->get('ChangeLogs');
     $this->versions = $this->get('Versions');
     $this->extraFields = $this->get('ExtraFields');
     $this->fieldsData = $this->app->getUserState("com_judownload.edit.document.fieldsdata", array());
     $this->relatedDocuments = $this->get('RelatedDocuments');
     $this->canDo = JUDownloadHelper::getActions('com_judownload', 'category', $this->item->cat_id);
     $this->addToolBar();
     $this->setDocument();
     parent::display($tpl);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:45,代码来源:view.html.php

示例11: display

	public function display($cachable = false, $urlparams = false)
	{
		$app      = JFactory::getApplication();
		$cachable = true;
		$id       = $app->input->getInt('id', 0);
		
		$vName = $app->input->getCmd('view', 'categories');
		$app->input->set('view', $vName);

		$user = JFactory::getUser();

		
		if ($user->get('id') ||
			($_SERVER['REQUEST_METHOD'] == 'POST' && (($vName == 'category' && $app->input->get('layout') != 'blog') || $vName == 'archive'))
		)
		{
			$cachable = false;
		}

		
		$safeurlparams = array('catid'   => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'UINT', 'limitstart' => 'UINT',
		                       'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD', 'Itemid' => 'INT');

		$params = JUDownloadHelper::getParams();
		
		if (!$user->authorise('core.admin', 'com_judownload') && $params->get('activate_maintenance', 0) && $app->input->getString('view', '') != 'maintenance')
		{
			$this->setRedirect(JUDownloadHelperRoute::getMaintenanceRoute());
		}

		
		if ($vName == 'form' && $id > 0 && !$this->checkEditId('com_judownload.edit.document', $id))
		{
			
			return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
		}

		
		parent::display($cachable, $safeurlparams);

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

示例12: getInput

 protected function getInput()
 {
     $params = JUDownloadHelper::getParams();
     $max_upload = ini_get('upload_max_filesize');
     if ($this->value) {
         $src = JUri::root(true) . "/" . JUDownloadFrontHelper::getDirectory("avatar_directory", "media/com_judownload/images/avatar/", true) . $this->value;
     } else {
         $src = JUri::root(true) . "/" . JUDownloadFrontHelper::getDirectory("avatar_directory", "media/com_judownload/images/avatar/", true) . "default/" . $params->get('default_avatar', 'default-avatar.png');
     }
     $html = '<div class="avatar" style="float: left;">';
     $html .= '<div class="clearfix"><img src="' . $src . '" alt="Avatar" style="width:' . $params->get("avatar_width", 120) . 'px; height:' . $params->get("avatar_height", 120) . 'px;" /></div>';
     if ($this->value) {
         $html .= '<label for="remove-avatar">' . JText::_("COM_JUDOWNLOAD_REMOVE_AVATAR") . '&nbsp;<input id="remove-avatar" type="checkbox" name="remove_avatar" value="1" /></label>';
     }
     $html .= '<div class="clearfix"><input type="file" name="avatar"  id="' . $this->id . '" />';
     $html .= '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '" /></div>';
     $html .= '<div class="clearfix"><i>' . JText::_("COM_JUDOWNLOAD_MAX_UPLOAD_FILESIZE") . ' <strong>' . JUDownloadHelper::formatBytes($this->convertBytes($max_upload)) . '</strong></i></div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:20,代码来源:avatar.php

示例13: populateState

	protected function populateState($ordering = null, $direction = null)
	{
		
		$app = JFactory::getApplication();

		$params = JUDownloadHelper::getParams();
		$this->setState('params', $params);

		
		if ($this->context)
		{
			$limitArray = JUDownloadFrontHelper::customLimitBox();

			if (is_array($limitArray) && count($limitArray))
			{
				$limit = $app->input->getUint('limit', null);
				if (is_null($limit) || in_array($limit, $limitArray))
				{
					$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
				}
				else
				{
					$limit = $app->getCfg('list_limit');
				}
			}
			else
			{
				$limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $app->getCfg('list_limit'), 'uint');
			}

			$this->setState('list.limit', $limit);

			$this->setState('list.start', $app->input->get('limitstart', 0, 'uint'));

			$orderCol = $app->getUserStateFromRequest($this->context . '.list.ordering', 'filter_order', 'tag.title');
			$this->setState('list.ordering', $orderCol);

			$listOrder = $app->getUserStateFromRequest($this->context . '.list.direction', 'filter_order_Dir', 'ASC');
			$this->setState('list.direction', $listOrder);
		}
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:41,代码来源:tags.php

示例14: getInput

    protected function getInput()
    {
        $params = JUDownloadHelper::getParams($this->form->getValue('id'));
        if ($this->element['directory'] == "intro") {
            $path = $params->get('category_intro_image_directory', 'media/com_judownload/images/category/intro/');
            $document = JFactory::getDocument();
            $script = 'jQuery(document).ready(function($){
								$("#use-detail-image").change(function(){
									if($(this).is(":checked")){
										$(this).parent().find("input[type=\'file\']").attr("disabled", true);
										$(this).parent().find("#remove-image-intro").prop("checked", false).attr("disabled", true);
									}else{
										$(this).parent().find("input[type=\'file\']").attr("disabled", false);
										$(this).parent().find("#remove-image-intro").prop("checked", true).attr("disabled", false);
									}
								});
							})';
            $document->addScriptDeclaration($script);
            $html = '<input type="file" name="images[intro]" class="validate-images" />';
        } else {
            $html = '<input type="file" name="images[detail]" class="validate-images" />';
            $path = $params->get('category_detail_image_directory', 'media/com_judownload/images/category/detail/');
        }
        $html .= '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '" />';
        if (!empty($this->value)) {
            $src = JUri::root() . $path . $this->value;
            $html .= '<label></label><img style="border: 5px solid #c0c0c0; max-width:100px; max-height:100px;" src="' . $src . '" />';
            $html .= '<div><input id="remove-image-' . $this->element['directory'] . '" type="checkbox" name="remove_' . $this->id . '" value="1" style="float: left; margin-right: 5px;"/>';
            $html .= '<label for="remove-image-' . $this->element['directory'] . '" >' . JText::_('COM_JUDOWNLOAD_REMOVE_THIS_IMAGE') . '</label></div>';
        }
        if ($this->element['directory'] == "intro") {
            $html .= '<div><input id="use-detail-image" type="checkbox" name="use_detail_image" value="1" style="float: left; margin-right: 5px;"/>';
            $html .= '<label class="hasTip" title="' . JText::_('COM_JUDOWNLOAD_USE_DETAIL_IMAGE_AS_INTRO_IMAGE') . '::' . JText::_('COM_JUDOWNLOAD_USE_DETAIL_IMAGE_AS_INTRO_IMAGE_DESC') . '" for="use-detail-image">';
            $html .= JText::_('COM_JUDOWNLOAD_USE_DETAIL_IMAGE_AS_INTRO_IMAGE');
            $html .= '</label></div>';
        }
        return $html;
    }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:38,代码来源:categoryimages.php

示例15: allowEnterPassword

	public static function allowEnterPassword($documentId)
	{
		$params                 = JUDownloadHelper::getParams(null, $documentId);
		$maxWrongPasswordTimes  = $params->get('max_wrong_password_times', 5);
		$blockEnterPasswordTime = $params->get('block_enter_password_time', 600);
		$session                = JFactory::getSession();
		$timeNow                = JFactory::getDate()->toSql();
		$timeNowStamp           = strtotime($timeNow);
		
		$ss_wrongPasswordTimes = 'judl-wrong-password-' . $documentId;
		
		$ss_blockDownloadTime = 'judl-block-download-time-' . $documentId;
		if ($session->has($ss_blockDownloadTime))
		{
			$waitTime = $timeNowStamp - $session->get($ss_blockDownloadTime);
		}
		else
		{
			$waitTime = 0;
		}

		if ($session->has($ss_wrongPasswordTimes))
		{
			$ss_wrongPasswordTimes = (int) $session->get($ss_wrongPasswordTimes);
		}
		else
		{
			$ss_wrongPasswordTimes = 0;
		}

		if ($ss_wrongPasswordTimes < $maxWrongPasswordTimes || $waitTime > $blockEnterPasswordTime)
		{
			return true;
		}

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


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