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


PHP Slug::setSlugAccordingToSlug方法代码示例

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


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

示例1: buildNormal


//.........这里部分代码省略.........
     						break;
     					}
     
     					case IMAGETYPE_PNG :
     					{
     
     						$pathToDerivative = sprintf(
     							'%1$sgallery/%2$s/%3$s.120.png',
     							$this->pathToImages, // 1
     							$img['nimi'], // 2
     							$img['name'] // 3
     						);
     
     						break;
     					}
     
     					default :
     					{
     					}
     
     				}
     
     				$tpl->setCurrentBlock('image');
     
     				$tpl->setVariable(array (
     					'CAPTION-OF-IMAGE' => $img['caption'],
     					'ID-OF-EVENT'      => $img['idEvent'],
     					'IMAGE'            => $pathToDerivative,
     					'INDEX-OF-IMAGE'   => $idx,
     					'NAME-OF-EVENT'    => $img['nimi'],
     					'WIDTH'            => $info[0],
     					'HEIGHT'           => $info[1]
     				));
     
     				$tpl->parseCurrentBlock();
     			}
     
     		}
     */
     if ($parameters['width'] > 320) {
         $page = new Page();
         $pages = $page->getListOfTypePage(array('forAutocompletion' => FALSE));
         // echo ' 1519: <pre>';print_r($psages); echo '</pre>';
         require_once O_FOLDER . 'Support.php';
         $sortedPages = Support::multiSort($pages, array('title' => TRUE, 'id' => TRUE));
         foreach ($sortedPages as $page) {
             $pageToHandle = new Page(NULL, $page['id']);
             // echo ' 1528: <pre>';print_r(debug_print_backtrace()); echo '</pre>';
             if (is_object($parameters['user']) && $parameters['user']->isAllowed('r', $pageToHandle) && $pageToHandle->isCompetitionPage()) {
                 require_once 'puu/SystemMenuItem.php';
                 $menuEl = new SystemMenuItem();
                 require_once 'Slug.php';
                 $slug = new Slug();
                 $slug->setSlugOfSlug($pageToHandle->getSlug());
                 $slug->setSlugAccordingToSlug();
                 $menuEl->pageID = $slug->getIdOfSlug();
                 $menuEl->setTypeOfBoundObject('page');
                 $atLeastOneActive = $menuEl->setAttributes(FALSE, $page['id']);
             }
         }
         if (isset($_GET['page']) && $_GET['page'] == 1 && !isset($_GET['news']) && !OFFLINE) {
             $pathToRoot = Support::getPathToRootDir();
             foreach ($images as $idx => $img) {
                 $picAddress = sprintf('%1$s../originals/assets/images/gallery/%2$s/%3$s', $pathToRoot, $img['nimi'], $img['name']);
                 if (is_readable($picAddress)) {
                     $info = getimagesize($picAddress);
                     switch ($info[2]) {
                         case IMAGETYPE_GIF:
                             $pathToDerivative = sprintf('%1$s%2$sgallery/%3$s/%4$s.367.gif', DOMAIN, IMAGES_FOLDER, $img['nimi'], $img['name']);
                             break;
                         case IMAGETYPE_JPEG:
                             $pathToDerivative = sprintf('%1$s%2$sgallery/%3$s/%4$s.367.jpg', DOMAIN, IMAGES_FOLDER, $img['nimi'], $img['name']);
                             break;
                         case IMAGETYPE_PNG:
                             $pathToDerivative = sprintf('%1$s%2$sgallery/%3$s/%4$s.367.png', DOMAIN, IMAGES_FOLDER, $img['nimi'], $img['name']);
                             break;
                         default:
                     }
                     $tpl->setCurrentBlock('image-in-gallery-in-news');
                     $tpl->setVariable(array('INDEX-OF-IMAGE-IN-GALLERY' => $idx, 'IMAGE-IN-GALLERY' => $pathToDerivative, 'ID-OF-EVENT-IN-GALLERY' => $img['idEvent'], 'NAME-OF-EVENT' => $img['nimi'], 'CAPTION-OF-IMAGE-IN-GALLERY' => $img['caption']));
                     $tpl->parseCurrentBlock();
                 }
             }
             $tpl->setCurrentBlock('gallery-in-news');
             $tpl->setVariable(array('BEGINNING-OF-URL-FOR-GALLERY' => DOMAIN));
             $tpl->parseCurrentBlock();
         }
     }
     $bestPlayers = '';
     if (!isset($parameters['isError']) || !$parameters['isError']) {
         if ($parameters['width'] > 899 && $parameters['width'] < 1301 || $parameters['width'] > 1799) {
             $bestPlayers = BodyView::buildBestPlayers(array('suffix' => $parameters['suffix'], 'width' => $parameters['width']));
         }
     }
     require_once O_FOLDER . 'rekvisiidid/RequisitesView.php';
     $tpl->setCurrentBlock('normal');
     $tpl->setVariable(array('BADGE-IN-NORMAL' => FB_BADGE, 'BEST-PLAYERS-IN-NORMAL' => $bestPlayers, 'CURRENT-SUPPORTER-LOGOS' => isset($parameters['currentSupporterLogos']) ? $parameters['currentSupporterLogos'] : '', 'FACEBOOK-API-KEY' => FB_API_KEY, 'FIRST-OUTER-NEWS' => isset($parameters['isError']) && $parameters['isError'] || !isset($parameters['outerNews']['first']) ? '' : $parameters['outerNews']['first'], 'SECOND-OUTER-NEWS' => isset($parameters['isError']) && $parameters['isError'] || !isset($parameters['outerNews']['second']) ? '' : $parameters['outerNews']['second'], 'REMAINING-OUTER-NEWS' => isset($parameters['isError']) && $parameters['isError'] ? '' : (isset($parameters['outerNews']['remaining']) ? $parameters['outerNews']['remaining'] : $parameters['rss']), 'ID-OF-NEWS' => isset($parameters['idOfPageNews']) ? $parameters['idOfPageNews'] : '', 'LANGUAGES-IN-NORMAL' => isset($parameters['type']) ? BodyView::buildLanguageMenu(array('id' => isset($parameters['id']) ? $parameters['id'] : NULL, 'type' => $parameters['type'], 'suffix' => $parameters['suffix'], 'width' => $parameters['width'])) : '', 'LOGGED-IN' => $parameters['login'], 'MENU-LOGGED-IN-NORMAL' => isset($menus['loggedIn']) ? $menus['loggedIn'] : '', 'NEWS' => isset($builtNews) ? $builtNews : '', 'NEWS-LIST' => isset($newsList) ? $newsList : '', 'LOCATION-IN-NORMAL' => DOMAIN, 'MAIN-BUTTONS' => SystemMenuItemView::buildWrapperForMainButtons(array('menu' => $parameters['menus']['mainButtons'], 'width' => $parameters['width'])), 'MENU-WITH-PRIORITY-LEVEL-2' => isset($parameters['menus']['forMainAdministrator']) ? $parameters['menus']['forMainAdministrator'] : '', 'MENU-WITH-PRIORITY-LEVEL-OPEN' => isset($parameters['menus']['forRegisteredUser']) ? $parameters['menus']['forRegisteredUser'] : '', 'MENU-WITH-PRIORITY-PUBLIC' => isset($parameters['menus']['public']) ? $parameters['menus']['public'] : '', 'NESTED-SETS-IN-CURRENT-SUPPORTER-LOGOS' => NESTED_SET_SUPPORTERS, 'REQUISITES-IN-NORMAL' => \o\RequisitesView::buildRequisites(array('user' => $parameters['user'], 'width' => $parameters['width'])), 'USERNAME-IN-FACEBOOK-NORMAL' => ALBUMS));
     $tpl->parseCurrentBlock();
     return $tpl->get('normal');
 }
开发者ID:piiskop,项目名称:pstk,代码行数:101,代码来源:BodyView.php


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