本文整理汇总了PHP中ffContainer函数的典型用法代码示例。如果您正苦于以下问题:PHP ffContainer函数的具体用法?PHP ffContainer怎么用?PHP ffContainer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ffContainer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createUser
public function createUser()
{
$this->_getClassloader()->loadClass('ffUser');
$user = new ffUser();
$user->setWPLayer(ffContainer()->getWPLayer());
return $user;
}
示例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;
}
示例3: getUserModel
public function getUserModel()
{
$this->_getClassloader()->loadClass('ffUserModel');
$userFactory = $this->getUserFactory();
$userModel = new ffUserModel($userFactory, ffContainer()->getCiphers());
return $userModel;
}
示例4: getShortcodeFactory
public function getShortcodeFactory()
{
$this->_getClassloader()->loadClass('ffShortcodeObjectBasic');
$this->_getClassloader()->loadClass('ffShortcodeFactory');
$scFactory = new ffShortcodeFactory($this->_getClassloader());
$scFactory->setWPLayer(ffContainer()->getWPLayer());
return $scFactory;
}
示例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);
}
示例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');
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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'];
}
示例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;
}
}