本文整理汇总了PHP中ffContainer函数的典型用法代码示例。如果您正苦于以下问题:PHP ffContainer函数的具体用法?PHP ffContainer怎么用?PHP ffContainer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ffContainer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createUser
public function createUser()
{
$this->_getClassloader()->loadClass('ffUser');
$user = new ffUser();
$user->setWPLayer(ffContainer()->getWPLayer());
return $user;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffUserFactory.php
示例2: getImageHttpManager
public function getImageHttpManager()
{
$this->_getClassloader()->loadClass('ffImageHttpManager');
$container = ffContainer();
$imageHttpManager = new ffImageHttpManager($container->getWPLayer(), $container->getHttpAction(), $container->getGraphicFactory()->getImageServingObject(), $container->getFileSystem());
return $imageHttpManager;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffGraphicFactory.php
示例3: getUserModel
public function getUserModel()
{
$this->_getClassloader()->loadClass('ffUserModel');
$userFactory = $this->getUserFactory();
$userModel = new ffUserModel($userFactory, ffContainer()->getCiphers());
return $userModel;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffUserNamespaceFactory.php
示例4: getShortcodeFactory
public function getShortcodeFactory()
{
$this->_getClassloader()->loadClass('ffShortcodeObjectBasic');
$this->_getClassloader()->loadClass('ffShortcodeFactory');
$scFactory = new ffShortcodeFactory($this->_getClassloader());
$scFactory->setWPLayer(ffContainer()->getWPLayer());
return $scFactory;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:8,代码来源:class.ffShortcodesNamespaceFactory.php
示例5: _initMetaBox
protected function _initMetaBox()
{
$themeLayoutManager = ffContainer()->getThemeFrameworkFactory()->getLayoutsNamespaceFactory()->getThemeLayoutManager();
$this->_addPostType($themeLayoutManager->getLayoutPostTypeName());
$this->_setTitle('Layout Placement');
$this->_setContext(ffMetaBox::CONTEXT_SIDE);
$this->_setParam(ffMetaBox::PARAM_NORMALIZE_OPTIONS, true);
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:8,代码来源:class.ffMetaBoxLayoutPlacement.php
示例6: _initMetaBox
protected function _initMetaBox()
{
$themeLayoutManager = ffContainer()->getThemeFrameworkFactory()->getLayoutsNamespaceFactory()->getThemeLayoutManager();
$this->_addPostType($themeLayoutManager->getLayoutPostTypeName());
$this->_setTitle('Layout');
$this->_setContext(ffMetaBox::CONTEXT_NORMAL);
$this->_setParam(ffMetaBox::PARAM_NORMALIZE_OPTIONS, true);
//$this->_addVisibility( ffMetaBox::VISIBILITY_PAGE_TEMPLATE, 'page-onepage.php');
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:9,代码来源:class.ffMetaBoxLayoutContent.php
示例7: ff_load_section_printer
function ff_load_section_printer($sectionName, ffOptionsQuery $query, $params = array(), $isFirstLevel = false)
{
//loop-influence-portfolio-block
$fileSystem = ffContainer()->getFileSystem();
$relativePath = ff_get_section_path($sectionName);
$absolutePath = $fileSystem->locateFileInChildTheme($relativePath);
if ($query->queryExists('section-settings') && $isFirstLevel) {
ff_print_before_section($query->get('section-settings'));
}
if (($query->queryExists('loop-influence-portfolio-block') || $query->queryExists('loop-influence-post-block')) && !is_search() && !is_archive() && !(is_home() && is_front_page())) {
if ($query->queryExists('loop-influence-portfolio-block')) {
$taxonomyIds = $query->get('loop-influence-portfolio-block')->getMultipleSelect('categories');
$taxType = 'ff-portfolio-category';
$postType = 'portfolio';
} else {
$taxonomyIds = $query->get('loop-influence-post-block')->getMultipleSelect('categories');
$postType = 'post';
$taxType = 'category';
}
$args = array('post_type' => $postType);
$taxonomies = $taxonomyIds;
if (1 == count($taxonomies)) {
if (isset($taxonomies[0]) and empty($taxonomies[0])) {
$taxonomies = null;
}
}
if (!empty($taxonomies)) {
$args['tax_query'] = array();
if (1 < count($taxonomies)) {
$args['tax_query']['relation'] = 'OR';
}
foreach ($taxonomies as $tax_ID) {
$args['tax_query'][] = array('taxonomy' => $taxType, 'field' => 'id', 'terms' => absint($tax_ID));
}
}
global $wp_query;
$backuped_main_query = clone $wp_query;
$wp_query = new WP_Query($args);
}
if ($fileSystem->fileExists($absolutePath)) {
require $absolutePath;
} else {
throw new Exception('Failed to include section:' . $relativePath);
}
// if( ($query->queryExists('loop-influence-portfolio-block') || $query->queryExists('loop-influence-post-block')) && !is_archive() ) {
if (!empty($backuped_main_query)) {
global $wp_query;
$wp_query = $backuped_main_query;
}
if ($query->queryExists('section-settings') && $isFirstLevel) {
ff_print_after_section($query->get('section-settings'));
}
if (isset($dataToReturn)) {
return $dataToReturn;
}
return null;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:57,代码来源:sections.php
示例8: createBreadcrumbs
public function createBreadcrumbs()
{
$this->_getClassloader()->loadClass('ffBreadcrumbsCollectionFactory');
$this->_getClassloader()->loadClass('ffOneBreadcrumbFactory');
$breadcrumbsFactory = new ffBreadcrumbsCollectionFactory($this->_getClassloader());
$oneBreadcrumbFactory = new ffOneBreadcrumbFactory($this->_getClassloader());
$this->_getClassloader()->loadClass('ffBreadcrumbs');
$breadcrumbs = new ffBreadcrumbs($breadcrumbsFactory->createBreadcrumbsCollection(), $oneBreadcrumbFactory, ffContainer()->getWPLayer(), ffContainer()->getFrontendQueryIdentificator(), ffContainer()->getCustomTaxonomyIdentificator());
return $breadcrumbs;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:10,代码来源:class.ffLibManager.php
示例9: createAdminScreen
/**
*
* @param unknown $adminScreenClassName
* @return ffIAdminScreen
*/
public function createAdminScreen($adminScreenClassName)
{
$this->_getClassloader()->loadClass('ffIAdminScreen');
if ($this->_getClassloader()->classRegistered($adminScreenClassName)) {
$this->_getClassloader()->loadClass($adminScreenClassName);
$request = ffContainer()->getRequest();
$adminScreenClassInstance = new $adminScreenClassName($this->_getMenuFactory(), $this->_getAdminScreenViewFactory(), $request);
return $adminScreenClassInstance;
} else {
throw new Exception('AdminScreenFactory -> Trying to create class ' . $adminScreenClassName . ', but it does not exists!');
}
return false;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:18,代码来源:class.ffAdminScreenFactory.php
示例10: _save
protected function _save($postId)
{
return;
$fwc = ffContainer::getInstance();
$layoutsDataManager = ffContainer()->getThemeFrameworkFactory()->getLayoutsNamespaceFactory()->getLayoutsDataManager();
$collection = $layoutsDataManager->getLayoutCollection();
$item = $collection->getLayoutById($postId);
$options = $fwc->getOptionsFactory()->createOptionsHolder('ffOptionsHolder_Layout_Conditions')->getOptions();
$postReader = $fwc->getOptionsFactory()->createOptionsPostReader($options);
$value = $postReader->getData('conditions');
$item->setConditional($value);
// $layoutsDataManager->saveLayoutCollection();
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:13,代码来源:class.ffMetaBoxLayoutConditionsView.php
示例11: getLayoutsDataManager
public function getLayoutsDataManager()
{
if ($this->_ldm == null) {
$this->_getClassloader()->loadClass('ffLayoutsDataManager');
if (defined('ffThemeContainer::THEME_NAME_LOW')) {
$themeName = ffThemeContainer::THEME_NAME_LOW;
} else {
$themeName = 'universal-layout';
}
$dataStorage = ffContainer()->getDataStorageFactory()->createDataStorageOptionsPostType_NamespaceFacade();
$this->_ldm = new ffLayoutsDataManager($this->getLayoutsCollectionFactory(), $themeName, $dataStorage, ffContainer()->getDataStorageFactory());
}
return $this->_ldm;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:14,代码来源:class.ffLayoutsNamespaceFactory.php
示例12: _render
protected function _render($post)
{
$layoutsDataManager = ffContainer()->getThemeFrameworkFactory()->getLayoutsNamespaceFactory()->getLayoutsDataManager();
$collection = $layoutsDataManager->getLayoutCollection();
$item = $collection->getLayoutById($post->ID);
$fwc = ffContainer::getInstance();
$fwc->getWPLayer()->add_action('admin_footer', array($this, 'requireModalWindows'), 1);
$s = $fwc->getOptionsFactory()->createOptionsHolder('ffOptionsHolder_Layout_Placement')->getOptions();
//createStructure('portfolio');
$value = $item->getPlacement();
//$fwc->getDataStorageFactory()->createDataStorageOptionsPostType_NamespaceFacade(ffThemeContainer::THEME_NAME_LOW.'-layouts', true)->getOptionCoded('placements');
$printer = $fwc->getOptionsFactory()->createOptionsPrinterBoxed($value, $s);
$printer->setNameprefix('placement');
$printer->walk();
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:15,代码来源:class.ffMetaBoxLayoutPlacementView.php
示例13: actResizeAndServeImage
public function actResizeAndServeImage($parameters)
{
if (!isset($parameters['image_name'])) {
return false;
}
$imageOptionName = $parameters['image_name'];
$imageData = $this->_getWPLayer()->get_option($imageOptionName);
if ($imageData == null) {
die;
}
$this->_getWPLayer()->delete_option($imageOptionName);
ffContainer()->getClassLoader()->loadClass('externFreshizer');
$newUrl = fImg::resize($imageData['url'], $imageData['width'], $imageData['height'], $imageData['crop'], false, false);
$path = $this->_getFileSystem()->findFileFromUrl($newUrl);
$this->_getImageServingObject()->serveImage($path);
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:16,代码来源:class.ffImageHttpManager.php
示例14: printComponent
public function printComponent($args, ffOptionsQuery $query)
{
$categories = $query->getMultipleSelect('latest-news categories');
$numberOfPosts = $query->get('latest-news number-of-posts');
$postGetter = ffContainer()->getPostLayer()->getPostGetter();
$posts = $postGetter->setFilterRelation_OR()->setNumberOfPosts($numberOfPosts)->filterByCategory($categories)->getAllPosts();
echo $args['before_widget'];
echo $args['before_title'];
echo ff_wp_kses($query->get('latest-news title'));
echo $args['after_title'];
echo '<ul';
if ('alt' == $query->get('latest-news style')) {
echo ' class="alt"';
}
echo '>';
if ('alt' == $query->get('latest-news style')) {
foreach ($posts as $onePost) {
$featuredImageUrl = $onePost->getFeaturedImage();
if (empty($featuredImageUrl)) {
continue;
}
$featuredImageUrlResized = fImg::resize($featuredImageUrl, 65, 65, true);
echo '<li>';
echo '<img src="' . esc_url($featuredImageUrlResized) . '" alt="">';
echo '<a href="' . get_permalink($onePost->getID()) . '" class="post-title">' . ff_wp_kses($onePost->getTitle()) . '</a>';
echo '<p class="post-date">' . ff_wp_kses($onePost->getDateFormated('F d, Y')) . '</p>';
echo '</li>';
}
} else {
foreach ($posts as $onePost) {
$featuredImageUrl = $onePost->getFeaturedImage();
if (empty($featuredImageUrl)) {
continue;
}
$featuredImageUrlResized = fImg::resize($featuredImageUrl, 80, 80, true);
echo '<li>';
echo '<img src="' . esc_url($featuredImageUrlResized) . '" alt="">';
echo '<p class="news-title">';
echo '<a href="' . get_permalink($onePost->getID()) . '">' . ff_wp_kses($onePost->getTitle()) . '</a>';
echo '</p>';
echo '<p class="news-date">' . ff_wp_kses($onePost->getDateFormated('F d, Y')) . '</p>';
echo '</li>';
}
}
echo '</ul>';
echo $args['after_widget'];
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:47,代码来源:class.ffComponent_LatestNewsWidget_Printer.php
示例15: _updateFramework
private function _updateFramework()
{
$versionManager = ffFrameworkVersionManager::getInstance();
$latestInstalledVersion = $versionManager->getLatestInstalledVersion();
$newFrameworkVersion = $this->_getFrameworkVersion();
$pluginInstaller = ffContainer()->getPluginInstaller();
if (version_compare($newFrameworkVersion, $latestInstalledVersion, '>')) {
if ($pluginInstaller->installPluginFromZipFile(get_template_directory() . '/install/fresh-framework.zip', false, true)) {
header("Refresh:0");
die;
} else {
return;
}
} else {
return;
}
}
开发者ID:gidbot,项目名称:treble_zero,代码行数:17,代码来源:init.php
示例16: _translateLinkStringIntoInnerFormat
protected function _translateLinkStringIntoInnerFormat($linkString)
{
$linkString = trim($linkString);
$linkString = strip_tags($linkString);
if (empty($linkString)) {
return null;
}
if ('#' == substr($linkString, 0, 1)) {
return null;
}
if (ffContainer()->getWPLayer()->is_email($linkString)) {
return (object) array('type' => 'envelope', 'link' => 'mailto:' . $linkString, 'title' => 'E-mail');
}
if ('http' != substr($linkString, 0, 4)) {
if (FALSE !== strpos($linkString, ":")) {
$e = explode(":", $linkString, 2);
$sType = trim($e[0]);
$link = trim($e[1]);
return (object) array('type' => $sType, 'link' => $link, 'title' => $this->_possible_social_links[$sType]['title']);
}
}
$socType = null;
$socLink = null;
$socProtocol = null;
if ('https://' == substr($linkString, 0, 8)) {
$linkString = substr($linkString, 8);
$socProtocol = 'https://';
} else {
if ('http://' == substr($linkString, 0, 7)) {
$linkString = substr($linkString, 7);
$socProtocol = 'http://';
} else {
$socProtocol = 'http://';
}
}
$slashPosition = strpos($linkString, '/');
$domain = substr($linkString, 0, $slashPosition);
foreach ($this->_possible_social_links as $sType => $sDefinitions) {
if (FALSE !== strpos($domain, $sDefinitions['url_substr'] . '.')) {
return (object) array('type' => $sType, 'link' => $socProtocol . $linkString, 'title' => $this->_possible_social_links[$sType]['title']);
}
}
return null;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:44,代码来源:class.ffSocialFeedCreator.php
示例17: createOptionsHolder
/**
* @param $className
* @return ffOptionsHolder
* @throws Exception
*/
public function createOptionsHolder($className)
{
$this->_getClassloader()->loadClass('ffIOptionsHolder');
$this->_getClassloader()->loadClass('ffOptionsHolder');
$this->_getClassloader()->loadClass('ffOptionsHolder_CachingFacade');
$this->_getClassloader()->loadClass($className);
$this->_getClassloader()->loadClass('ffIOneDataNode');
$this->_getClassloader()->loadClass('ffOneSection');
$this->_getClassloader()->loadClass('ffOneOption');
$this->_getClassloader()->loadClass('ffOneStructure');
$this->_getClassloader()->loadClass('ffOneElement');
$optionsHolder = new $className($this->_getOnestructurefactory(), $this);
$container = ffContainer();
if ($container->getWPLayer()->get_ff_debug()) {
return $optionsHolder;
}
$classLoader = $container->getClassLoader();
$fileSystem = $container->getFileSystem();
$cache = $container->getDataStorageCache();
$optionsHolderCachingFacade = new ffOptionsHolder_CachingFacade($optionsHolder, $classLoader, $fileSystem, $cache);
return $optionsHolderCachingFacade;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:27,代码来源:class.ffOptionsHolder_Factory.php
示例18: printComponent
public function printComponent($args, ffOptionsQuery $query)
{
$categories = $query->getMultipleSelect('latest-portfolio categories');
$categoriesCheck = $query->get('latest-portfolio categories');
if (empty($categoriesCheck) || $categoriesCheck == 'all') {
$categories = null;
}
$numberOfPosts = $query->get('latest-portfolio number-of-posts');
$postGetter = ffContainer()->getPostLayer()->getPostGetter();
$posts = $postGetter->setFilterRelation_OR()->setNumberOfPosts($numberOfPosts)->filterByTaxonomy($categories, 'ff-portfolio-category')->getAll();
// var_dump( $posts, $categories, $numberOfPosts );
// var_Dump( $posts );
echo $args['before_widget'];
echo $args['before_title'];
echo ff_wp_kses($query->get('latest-portfolio title'));
echo $args['after_title'];
if (!empty($posts)) {
echo '<div class="portfolio-photos">';
foreach ($posts as $onePost) {
$featuredImage = $onePost->getFeaturedImage();
if (empty($featuredImage)) {
continue;
}
echo '<div class="portfolio-badge-image">';
echo '<a href="' . get_permalink($onePost->getID()) . '">';
echo '<img width="75" height="75" title="" alt="" src="' . esc_url(fImg::resize($featuredImage, 75, 75, true)) . '">';
echo '</a>';
echo '</div>';
}
if ($query->get('latest-portfolio show-description')) {
echo '<p>' . ff_wp_kses($query->get('latest-portfolio description')) . '</p>';
}
echo '</div>';
}
echo $args['after_widget'];
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:36,代码来源:class.ffComponent_LatestPortfolioWidget_Printer.php
示例19: ff_generate_and_print_color_accent
function ff_generate_and_print_color_accent()
{
$defaultAccentColorString = '#bca480';
$useAccent = ffThemeOptions::getQuery('layout use-picker');
if (!$useAccent) {
return false;
}
// new color in format #aabbcc
$colorHEX = ffThemeOptions::getQuery('layout color');
// caching for directory wp-content/uploads/freshframework/ NAMESPACE / VALUE . EXTENSION
$dataStorageCache = ffContainer()->getInstance()->getDataStorageCache();
// #aabbcc -> aabbcc
$colorWithoutHex = str_replace('#', '', $colorHEX);
$optionName = 'accent-' . esc_attr($colorWithoutHex);
if (!$dataStorageCache->optionExists('milo_accents', $optionName, 'css')) {
$dataStorageCache->deleteOldFilesInNamespace('milo_accents', 60 * 60 * 24 * 7, 60 * 60 * 24 * 3);
// with #bca480
$colorAccentFileContent = ff_get_color_accent_file_content();
$newColorAccentFile = str_replace($defaultAccentColorString, $colorHEX, $colorAccentFileContent);
$dataStorageCache->setOption('milo_accents', $optionName, $newColorAccentFile, 'css');
}
$accentUrl = $dataStorageCache->getOptionUrl('milo_accents', $optionName, 'css');
wp_enqueue_style('ff-milo-color-accent', $accentUrl);
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:24,代码来源:color-accent-generation.php
示例20: _getPostMetaGetter
protected function _getPostMetaGetter()
{
if ($this->_postMetaGetter == null) {
$this->_postMetaGetter = ffContainer()->getThemeFrameworkFactory()->getPostMetaGetter();
}
return $this->_postMetaGetter;
}
开发者ID:migumuno,项目名称:nordicainteriores,代码行数:7,代码来源:class.ffCommentWalker.php
注:本文中的ffContainer函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论