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


PHP JUDirectoryHelper::getParams方法代码示例

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


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

示例1: 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_judirectory/assets/js/captcha.js");
        $params = JUDirectoryHelper::getParams();
        $captchaNameSpaceValue = !$captchaNameSpaceValue ? md5(time()) : $captchaNameSpaceValue;
        $html = '';
        if ($label) {
            $html .= '<div class="control-group">';
            $html .= '<label class="control-label" for="' . $id . '">' . JText::_('COM_JUDIRECTORY_CAPTCHA') . '<span class="required" style="color: red">*</span></label>';
            $html .= '<div class="controls">';
        }
        $html .= '<div class="judir-captcha pull-left">';
        $html .= '<div class="clearfix">';
        if ($hiddenCaptcha == false) {
            $html .= '<img class="captcha-image" alt="' . JText::_('COM_JUDIRECTORY_CAPTCHA') . '"
							src="' . JUri::root(true) . '/index.php?option=com_judirectory&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_JUDIRECTORY_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_JUDIRECTORY_RELOAD_CAPTCHA') . '"><i class="fa fa-refresh" ></i></span>';
        $html .= '</div>';
        $html .= '</div>';
        if ($label) {
            $html .= '</div>';
            $html .= '</div>';
        }
        return $html;
    }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:35,代码来源:captcha.php

示例2: canView

 public function canView($options = array())
 {
     $storeId = md5(__METHOD__ . "::" . $this->listing_id . "::" . $this->id . "::" . serialize($options));
     if (!isset(self::$cache[$storeId])) {
         if (!$this->isPublished()) {
             self::$cache[$storeId] = false;
             return self::$cache[$storeId];
         }
         if (isset($this->listing) && $this->listing->cat_id) {
             $params = JUDirectoryHelper::getParams($this->listing->cat_id);
         } else {
             $params = JUDirectoryHelper::getParams(null, $this->listing_id);
         }
         $show_empty_field = $params->get('show_empty_field', 0);
         if ($this->listing_id && !$show_empty_field) {
             if (intval($this->value) == 0) {
                 self::$cache[$storeId] = false;
                 return self::$cache[$storeId];
             }
         }
         self::$cache[$storeId] = parent::canView($options);
         return self::$cache[$storeId];
     }
     return self::$cache[$storeId];
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:25,代码来源:core_updated.php

示例3: populateState

 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $pk = $app->input->getInt('id', 0);
     $this->setState('tag.id', $pk);
     $params = JUDirectoryHelper::getParams();
     $this->setState('params', $params);
     if ($this->context) {
         $listingPagination = $params->get('listing_pagination', 10);
         $limitArray = JUDirectoryFrontHelper::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', $listingPagination, 'uint');
             } else {
                 $limit = $listingPagination;
             }
         } else {
             $limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $listingPagination, '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:ranrolls,项目名称:ras-full-portal,代码行数:31,代码来源:tag.php

示例4: populateState

 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $catId = $app->input->getInt('id', 1);
     $params = JUDirectoryHelper::getParams($catId);
     $this->setState('params', $params);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:7,代码来源:categories.php

示例5: display

 public function display($tpl = null)
 {
     $this->user = JFactory::getUser();
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     $this->authors = $this->get('Authors');
     $this->params = JUDirectoryHelper::getParams();
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode('<br />', $errors));
         return false;
     }
     $levelOptions = array();
     $levelOptions[] = JHtml::_('select.option', 5, 5);
     $levelOptions[] = JHtml::_('select.option', 10, 10);
     $levelOptions[] = JHtml::_('select.option', 15, 15);
     $levelOptions[] = JHtml::_('select.option', 20, 20);
     $levelOptions[] = JHtml::_('select.option', 25, 25);
     $levelOptions[] = JHtml::_('select.option', 30, 30);
     $this->levelOptions = $levelOptions;
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $app = JFactory::getApplication();
     $this->function = $app->input->get('function', 'jSelectListing');
     $this->totalListings = $this->get('Total');
     $this->_prepareDocument();
     parent::display($tpl);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:28,代码来源:view.html.php

示例6: getDefaultAvatar

 public static function getDefaultAvatar($params = null)
 {
     if (!$params) {
         $params = JUDirectoryHelper::getParams();
     }
     $linkAvatar = $src = JUri::root(true) . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/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:ranrolls,项目名称:ras-full-portal,代码行数:12,代码来源:avatar.php

示例7: 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);
     $params = JUDirectoryHelper::getParams();
     $this->setState('params', $params);
     parent::populateState('listing.title', 'asc');
     $field_display = $this->getUserStateFromRequest($this->context . '.field_display', 'field_display', array());
     $this->setState('field_display', $field_display);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:14,代码来源:embedlisting.php

示例8: getInput

 protected function getInput()
 {
     $params = JUDirectoryHelper::getParams();
     $max_upload = ini_get('upload_max_filesize');
     $src = JUri::root() . JUDirectoryFrontHelper::getDirectory("collection_icon_directory", "media/com_judirectory/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_JUDIRECTORY_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_JUDIRECTORY_MAX_UPLOAD_FILESIZE') . " <strong>" . JUDirectoryHelper::formatBytes($this->convertBytes($max_upload)) . "</strong></i></div>";
     $html .= "</div>";
     return $html;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:16,代码来源:collectionicon.php

示例9: getWysibbEditor

 public static function getWysibbEditor($jQuerySelector = '.wysibb', $returnJS = false, $readmore = false)
 {
     $params = JUDirectoryHelper::getParams();
     $wysibbButtons['bold,'] = $params->get('bb_bold_tag', 'Bold');
     $wysibbButtons['italic,'] = $params->get('bb_italic_tag', 'Italic');
     $wysibbButtons['underline,'] = $params->get('bb_underline_tag', 'Underline');
     $wysibbButtons['img,'] = $params->get('bb_img_tag', 'Picture');
     $wysibbButtons['link,'] = $params->get('bb_link_tag', 'Link');
     $wysibbButtons['video,'] = $params->get('bb_video_tag', 'Video');
     $wysibbButtons['smilebox,'] = $params->get('bb_smilebox_tag', 'Smilebox');
     $wysibbButtons['fontcolor,'] = $params->get('bb_color_tag', 'Colors');
     $wysibbButtons['fontsize,'] = $params->get('bb_fontsize_tag', 'Fontsize');
     $wysibbButtons['justifyleft,'] = $params->get('bb_align_left', 'alignleft');
     $wysibbButtons['justifycenter,'] = $params->get('bb_align_center', 'aligncenter');
     $wysibbButtons['justifyright,'] = $params->get('bb_align_right', 'alignright');
     $wysibbButtons['bullist,'] = $params->get('bb_bulleted_list', 'Bulleted-list');
     $wysibbButtons['numlist,'] = $params->get('bb_numeric_list', 'Numeric-list');
     $wysibbButtons['quote,'] = $params->get('bb_quote_tag', 'Quotes');
     if ($readmore == true) {
         $wysibbButtons['readmore,'] = $params->get('bb_readmore_tag', 'Readmore');
     }
     $buttons = '';
     $i = 0;
     foreach ($wysibbButtons as $key => $value) {
         if ($i % 3 == 0) {
             $buttons .= "|,";
         }
         if ($value) {
             $buttons .= $key;
         }
         $i++;
     }
     $script = " jQuery(document).ready(function(\$){\n\t\t\t\t\t\tjudirWbbOpt.minCommentChar = " . (int) $params->get('min_comment_characters', 20) . ";\n\t\t\t\t\t\tjudirWbbOpt.maxCommentChar = " . (int) $params->get('max_comment_characters', 1000) . ";\n\t\t\t\t\t\tjudirWbbOpt.buttons = '{$buttons}';\n\t\t\t\t\t\tjudirWbbOpt.lang = 'en';\n\n\t\t\t\t\t\t\$('{$jQuerySelector}').wysibb(judirWbbOpt);\n\t\t\t\t\t}); ";
     if ($returnJS == true) {
         return '<script type="text/javascript">' . $script . '</script>';
     } else {
         JText::script('COM_JUDIRECTORY_READMORE_WYSIBB_ALREADY_EXISTS');
         JText::script('COM_JUDIRECTORY_PLEASE_ENTER_AT_LEAST_N_CHARACTERS');
         JText::script('COM_JUDIRECTORY_CONTENT_LENGTH_REACH_MAX_N_CHARACTERS');
         $document = JFactory::getDocument();
         $document->addStyleSheet(JUri::root(true) . "/components/com_judirectory/assets/wysibb/theme/default/wbbtheme.css");
         $document->addScript(JUri::root(true) . "/components/com_judirectory/assets/wysibb/jquery.wysibb.js");
         $document->addScript(JUri::root(true) . "/components/com_judirectory/assets/wysibb/override.jquery.wysibb.js");
         $document->addScript(JUri::root(true) . "/components/com_judirectory/assets/wysibb/preset/phpbb3.js");
         $document->addScriptDeclaration($script);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:47,代码来源:editor.php

示例10: getValue

 protected function getValue()
 {
     $app = JFactory::getApplication();
     if ($app->isSite() && isset($this->listing->total_comments) && !is_null($this->listing->total_comments)) {
         return $this->listing->total_comments;
     }
     $user = JFactory::getUser();
     $db = JFactory::getDbo();
     if ($app->isSite()) {
         $query = $db->getQuery(true);
         $query->select('COUNT(*)');
         $query->from('#__judirectory_comments AS cm');
         $query->where('listing_id =' . $this->listing_id);
         $query->where('level = 1');
         $query->where('approved = 1');
         $moderator = JUDirectoryFrontHelperModerator::getModerator($this->listing->cat_id);
         $getAll = false;
         if ($user->authorise('core.admin', 'com_judirectory')) {
             $getAll = true;
         }
         if (is_object($moderator)) {
             if ($moderator->comment_edit || $moderator->comment_edit_state || $moderator->comment_delete) {
                 $getAll = true;
             }
         }
         if (!$getAll) {
             $query->where('published = 1');
             $params = JUDirectoryHelper::getParams(null, $this->listing_id);
             $negative_vote_comment = $params->get('negative_vote_comment');
             if (is_numeric($negative_vote_comment) && $negative_vote_comment > 0) {
                 $query->where('(total_votes - helpful_votes) <' . $negative_vote_comment);
             }
         }
     } else {
         $query = $db->getQuery(true);
         $query->select('COUNT(*)');
         $query->from('#__judirectory_comments AS cm');
         $query->where('listing_id =' . $this->listing_id);
         $query->where('level = 1');
         $query->where('approved = 1');
     }
     $db->setQuery($query);
     $totalComments = $db->loadResult();
     return $totalComments;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:45,代码来源:core_comments.php

示例11: 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 = JUDirectoryHelper::getParams(null, $this->item->id);
     if ($cat_id == JUDirectoryFrontHelperCategory::getRootCategory()->id && !$this->params->get('allow_add_listing_to_root', 0)) {
         JError::raiseError(500, JText::_('COM_JUDIRECTORY_CAN_NOT_ADD_LISTING_TO_ROOT_CATEGORY'));
         return false;
     }
     if ($tempListing = JUDirectoryHelper::getTempListing($this->item->id)) {
         $editPendingListingLink = '<a href="index.php?option=com_judirectory&task=document.edit&approve=1&id=' . $tempListing->id . '">' . $tempListing->title . '</a>';
         JError::raiseNotice('', JText::sprintf('COM_JUDIRECTORY_THIS_LISTING_HAS_PENDING_LISTING_X_PLEASE_APPROVE_PENDING_LISTING_FIRST', $editPendingListingLink));
     }
     if ($this->item->approved < 0) {
         $oriListingId = abs($this->item->approved);
         $oriListingObj = JUDirectoryHelper::getListingById($oriListingId);
         $editOriDocLink = '<a href="index.php?option=com_judirectory&task=document.edit&id=' . $oriListingId . '">' . $oriListingObj->title . '</a>';
         JError::raiseNotice('', JText::sprintf('COM_JUDIRECTORY_ORIGINAL_LISTING_X', $editOriDocLink));
     }
     $this->script = $this->get('Script');
     $this->plugins = $this->get('Plugins');
     $this->fieldLocations = $this->get('FieldLocations');
     $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 = JUDirectoryFrontHelperField::getField('cat_id', $this->item);
     $this->fieldGallery = $this->get('GalleryField');
     $this->extraFields = $this->get('ExtraFields');
     $this->fieldsData = $this->app->getUserState("com_judirectory.edit.listing.fieldsdata", array());
     $this->relatedListings = $this->get('RelatedListings');
     $this->canDo = JUDirectoryHelper::getActions('com_judirectory', 'category', $this->item->cat_id);
     $this->addToolBar();
     $this->setDocument();
     parent::display($tpl);
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:43,代码来源:view.html.php

示例12: getInput

 protected function getInput()
 {
     $params = JUDirectoryHelper::getParams();
     $max_upload = ini_get('upload_max_filesize');
     if ($this->value) {
         $src = JUri::root(true) . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/images/avatar/", true) . $this->value;
     } else {
         $src = JUri::root(true) . "/" . JUDirectoryFrontHelper::getDirectory("avatar_directory", "media/com_judirectory/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_JUDIRECTORY_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_JUDIRECTORY_MAX_UPLOAD_FILESIZE") . ' <strong>' . JUDirectoryHelper::formatBytes($this->convertBytes($max_upload)) . '</strong></i></div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:20,代码来源:avatar.php

示例13: populateState

 protected function populateState($ordering = null, $direction = null)
 {
     $app = JFactory::getApplication();
     $params = JUDirectoryHelper::getParams();
     if ($layout = $app->input->get('layout')) {
         $this->context .= '.' . $layout;
     }
     if ($this->context) {
         $listingPagination = $params->get('listing_pagination', 10);
         $limitArray = JUDirectoryFrontHelper::customLimitBox();
         if (is_array($limitArray) && count($limitArray)) {
             $limit = $app->input->getInt('limit', 0);
             if (in_array($limit, $limitArray)) {
                 $limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $listingPagination, 'uint');
             } else {
                 $limit = $listingPagination;
             }
         } else {
             $limit = $app->getUserStateFromRequest($this->context . '.list.limit', 'limit', $listingPagination, '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);
         $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
         $this->setState('filter.search', $search);
         $category = $this->getUserStateFromRequest($this->context . '.filter.category', 'filter_catid');
         $this->setState('filter.catid', $category);
         $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access');
         $this->setState('filter.access', $access);
         $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published');
         $this->setState('filter.published', $published);
         $featured = $this->getUserStateFromRequest($this->context . '.filter.featured', 'filter_featured');
         $this->setState('filter.featured', $featured);
     } else {
         $this->setState('list.start', 0);
         $this->state->set('list.limit', 0);
     }
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:41,代码来源:listings.php

示例14: 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 = JUDirectoryHelper::getParams();
     if (!$user->authorise('core.admin', 'com_judirectory') && $params->get('activate_maintenance', 0) && $app->input->getString('view', '') != 'maintenance') {
         $this->setRedirect(JUDirectoryHelperRoute::getMaintenanceRoute());
     }
     if ($vName == 'form' && $id > 0 && !$this->checkEditId('com_judirectory.edit.listing', $id)) {
         return JError::raiseError(403, JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
     }
     parent::display($cachable, $safeurlparams);
     return $this;
 }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:22,代码来源:controller.php

示例15: getInput

    protected function getInput()
    {
        $params = JUDirectoryHelper::getParams($this->form->getValue('id'));
        if ($this->element['directory'] == "intro") {
            $path = $params->get('category_intro_image_directory', 'media/com_judirectory/images/category/intro/');
            $document = JFactory::getDocument();
            $script = 'jQuery(document).ready(function($){
								$("#use-detail-image").change(function(){
									if($(this).is(":checked")){
										$(this).parent().parent().find("input[type=\'file\']").attr("disabled", true);
										$(this).parent().parent().find("#remove-image-intro").prop("checked", false).attr("disabled", true);
									}else{
										$(this).parent().parent().find("input[type=\'file\']").attr("disabled", false);
										$(this).parent().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_judirectory/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_JUDIRECTORY_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_JUDIRECTORY_USE_DETAIL_IMAGE_AS_INTRO_IMAGE') . '::' . JText::_('COM_JUDIRECTORY_USE_DETAIL_IMAGE_AS_INTRO_IMAGE_DESC') . '" for="use-detail-image">';
            $html .= JText::_('COM_JUDIRECTORY_USE_DETAIL_IMAGE_AS_INTRO_IMAGE');
            $html .= '</label></div>';
        }
        return $html;
    }
开发者ID:ranrolls,项目名称:ras-full-portal,代码行数:38,代码来源:categoryimages.php


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