本文整理汇总了PHP中Aimeos\MW\View\Iface类的典型用法代码示例。如果您正苦于以下问题:PHP Iface类的具体用法?PHP Iface怎么用?PHP Iface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Iface类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getDomains
/**
* Returns the list of domains that are available as resources
*
* @param \Aimeos\MW\View\Iface $view View object with "resource" parameter
* @return array List of domain names
*/
protected function getDomains(\Aimeos\MW\View\Iface $view)
{
if (($domains = $view->param('resource')) == '') {
/** admin/jsonadm/domains
* A list of domain names whose clients are available for the JSON API
*
* The HTTP OPTIONS method returns a list of resources known by the
* JSON API including their URLs. The list of available resources
* can be exteded dynamically be implementing a new Jsonadm client
* class handling request for this new domain.
*
* To add the new domain client to the list of resources returned
* by the HTTP OPTIONS method, you have to add its name in lower case
* to the existing configuration.
*
* @param array List of domain names
* @since 2016.01
* @category Developer
*/
$default = array('attribute', 'catalog', 'coupon', 'customer', 'locale', 'media', 'order', 'plugin', 'price', 'product', 'service', 'supplier', 'tag', 'text');
$domains = $this->getContext()->getConfig()->get('admin/jsonadm/domains', $default);
}
return (array) $domains;
}
开发者ID:aimeos,项目名称:ai-admin-jsonadm,代码行数:30,代码来源:Base.php
示例2: updateItems
/**
* Updates existing product text items or creates new ones
*
* @param \Aimeos\MW\View\Iface $view View object with helpers and assigned parameters
*/
protected function updateItems(\Aimeos\MW\View\Iface $view)
{
$id = $view->item->getId();
$context = $this->getContext();
$types = array('name', 'short', 'long', 'url', 'meta-keyword', 'meta-description');
$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
$textManager = \Aimeos\MShop\Factory::createManager($context, 'text');
$listManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists');
$listTypeManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists/type');
$listIds = array();
$langIds = (array) $view->param('text/langid', array());
$listItems = $manager->getItem($id, array('text'))->getListItems('text');
$listItem = $listManager->createItem();
$listItem->setTypeId($listTypeManager->findItem('default', array(), 'text')->getId());
$listItem->setDomain('text');
$listItem->setParentId($id);
$listItem->setStatus(1);
$textItem = $textManager->createItem();
$textItem->setDomain('product');
$textItem->setStatus(1);
foreach ($langIds as $idx => $langid) {
foreach ($types as $type) {
$content = trim($view->param('text/' . $type . '/content/' . $idx));
$listid = $view->param('text/' . $type . '/listid' . $idx);
$listIds[] = $listid;
if (!isset($listItems[$listid])) {
$litem = $listItem;
$litem->setId(null);
$item = $textItem;
$item->setId(null);
} else {
$litem = $listItems[$listid];
$item = $litem->getRefItem();
}
$item->setContent($content);
$item->setLabel(mb_strcut($item->getContent(), 0, 255));
$item->setTypeId($this->getTypeId($type));
$item->setLanguageId($langid);
$textManager->saveItem($item);
$litem->setPosition($idx);
$litem->setRefId($item->getId());
$listManager->saveItem($litem, false);
}
}
$rmIds = array();
$rmListIds = array_diff(array_keys($listItems), $listIds);
foreach ($rmListIds as $id) {
$rmIds[] = $listItems[$id]->getRefId();
}
$listManager->deleteItems($rmListIds);
$textManager->deleteItems($rmIds);
}
开发者ID:ajbm6,项目名称:aimeos-core,代码行数:57,代码来源:Standard.php
示例3: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$params = $this->getClientParams($view->param(), array('f', 'l'));
if (isset($params['f_catid']) && $params['f_catid'] != '') {
$context = $this->getContext();
$config = $context->getConfig();
$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
$default = array('attribute', 'media', 'text');
/** client/html/catalog/domains
* A list of domain names whose items should be available in the catalog view templates
*
* @see client/html/catalog/stage/domains
*/
$domains = $config->get('client/html/catalog/domains', $default);
/** client/html/catalog/stage/standard/domains
* A list of domain names whose items should be available in the catalog stage view template
*
* The templates rendering the catalog stage section use the texts and
* maybe images and attributes associated to the categories. You can
* configure your own list of domains (attribute, media, price, product,
* text, etc. are domains) whose items are fetched from the storage.
* Please keep in mind that the more domains you add to the configuration,
* the more time is required for fetching the content!
*
* This configuration option overwrites the "client/html/catalog/domains"
* option that allows to configure the domain names of the items fetched
* for all catalog related data.
*
* @param array List of domain names
* @since 2014.03
* @category Developer
* @see client/html/catalog/domains
* @see client/html/catalog/detail/domains
* @see client/html/catalog/lists/domains
*/
$domains = $config->get('client/html/catalog/stage/standard/domains', $domains);
$stageCatPath = $controller->getCatalogPath($params['f_catid'], $domains);
if (($categoryItem = end($stageCatPath)) !== false) {
$view->stageCurrentCatItem = $categoryItem;
}
$this->addMetaItems($stageCatPath, $this->expire, $this->tags);
$view->stageCatPath = $stageCatPath;
}
$view->stageParams = $params;
$this->cache = $view;
}
$expire = $this->expires($this->expire, $expire);
$tags = array_merge($tags, $this->tags);
return $this->cache;
}
开发者ID:aimeos,项目名称:ai-client-html,代码行数:59,代码来源:Standard.php
示例4: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$expire = null;
$tags = $items = array();
$context = $this->getContext();
$config = $context->getConfig();
$session = $context->getSession();
$default = array('media', 'price', 'text');
$domains = $config->get('client/html/catalog/domains', $default);
/** client/html/catalog/session/pinned/domains
* A list of domain names whose items should be available in the pinned view template for the product
*
* The templates rendering product details usually add the images,
* prices and texts, etc. associated to the product
* item. If you want to display additional or less content, you can
* configure your own list of domains (attribute, media, price, product,
* text, etc. are domains) whose items are fetched from the storage.
* Please keep in mind that the more domains you add to the configuration,
* the more time is required for fetching the content!
*
* From 2014.09 to 2015.03, this setting was available as
* client/html/catalog/detail/pinned/domains
*
* @param array List of domain names
* @since 2015.04
* @category Developer
* @see client/html/catalog/domains
* @see client/html/catalog/lists/domains
* @see client/html/catalog/detail/domains
*/
$domains = $config->get('client/html/catalog/session/pinned/domains', $domains);
$pinned = $session->get('aimeos/catalog/session/pinned/list', array());
$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'catalog');
$result = $controller->getProductItems($pinned, $domains);
foreach (array_reverse($pinned) as $id) {
if (isset($result[$id])) {
$items[$id] = $result[$id];
}
}
$view->pinnedProductItems = $items;
$view->pinnedParams = $this->getClientParams($view->param());
$this->cache = $view;
}
return $this->cache;
}
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:54,代码来源:Standard.php
示例5: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$context = $this->getContext();
$basketCntl = \Aimeos\Controller\Frontend\Factory::createController($context, 'basket');
try {
$langid = $basketCntl->get()->getAddress('payment')->getLanguageId();
} catch (\Exception $e) {
$langid = $view->param('ca_billing/order.base.address.languageid', $context->getLocale()->getLanguageId());
}
$view->billingLanguage = $langid;
/** client/html/checkout/standard/address/billing/hidden
* List of billing address input fields that are optional and should be hidden
*
* You can configure the list of billing address fields that
* are hidden when a customer enters his new billing address.
* Available field keys are:
* * order.base.address.company
* * order.base.address.vatid
* * order.base.address.salutation
* * order.base.address.firstname
* * order.base.address.lastname
* * order.base.address.address1
* * order.base.address.address2
* * order.base.address.address3
* * order.base.address.postal
* * order.base.address.city
* * order.base.address.state
* * order.base.address.languageid
* * order.base.address.countryid
* * order.base.address.telephone
* * order.base.address.telefax
* * order.base.address.email
* * order.base.address.website
*
* Caution: Only hide fields that don't require any input
*
* Until 2015-02, the configuration option was available as
* "client/html/common/address/billing/hidden" starting from 2014-03.
*
* @param array List of field keys
* @since 2015.02
* @category User
* @category Developer
* @see client/html/checkout/standard/address/billing/disable-new
* @see client/html/checkout/standard/address/billing/salutations
* @see client/html/checkout/standard/address/billing/mandatory
* @see client/html/checkout/standard/address/billing/optional
* @see client/html/checkout/standard/address/countries
*/
$hidden = $view->config('client/html/checkout/standard/address/billing/hidden', array());
if (count($view->get('addressLanguages', array())) === 1) {
$hidden[] = 'order.base.address.languageid';
}
$salutations = array('company', 'mr', 'mrs');
/** client/html/checkout/standard/address/billing/salutations
* List of salutions the customer can select from for the billing address
*
* The following salutations are available:
* * empty string for "unknown"
* * company
* * mr
* * mrs
* * miss
*
* You can modify the list of salutation codes and remove the ones
* which shouldn't be used. Adding new salutations is a little bit
* more difficult because you have to adapt a few areas in the source
* code.
*
* Until 2015-02, the configuration option was available as
* "client/html/common/address/billing/salutations" starting from 2014-03.
*
* @param array List of available salutation codes
* @since 2015.02
* @category User
* @category Developer
* @see client/html/checkout/standard/address/billing/disable-new
* @see client/html/checkout/standard/address/billing/mandatory
* @see client/html/checkout/standard/address/billing/optional
* @see client/html/checkout/standard/address/billing/hidden
* @see client/html/checkout/standard/address/countries
*/
$view->billingSalutations = $view->config('client/html/checkout/standard/address/billing/salutations', $salutations);
$view->billingMandatory = $view->config('client/html/checkout/standard/address/billing/mandatory', $this->mandatory);
$view->billingOptional = $view->config('client/html/checkout/standard/address/billing/optional', $this->optional);
$view->billingHidden = $hidden;
$this->cache = $view;
}
return $this->cache;
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:99,代码来源:Standard.php
示例6: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$config = $this->getContext()->getConfig();
/** client/html/catalog/count/enable
* Enables or disables displaying product counts in the catalog filter
*
* This configuration option allows shop owners to display product
* counts in the catalog filter or to disable fetching product count
* information.
*
* The product count information is fetched via AJAX and inserted via
* Javascript. This allows to cache parts of the catalog filter by
* leaving out such highly dynamic content like product count which
* changes with used filter parameter.
*
* @param boolean Value of "1" to display product counts, "0" to disable them
* @since 2014.03
* @category User
* @category Developer
* @see client/html/catalog/count/url/target
* @see client/html/catalog/count/url/controller
* @see client/html/catalog/count/url/action
* @see client/html/catalog/count/url/config
*/
if ($config->get('client/html/catalog/count/enable', true) == true) {
/** client/html/catalog/count/url/target
* Destination of the URL where the controller specified in the URL is known
*
* The destination can be a page ID like in a content management system or the
* module of a software development framework. This "target" must contain or know
* the controller that should be called by the generated URL.
*
* @param string Destination of the URL
* @since 2014.03
* @category Developer
* @see client/html/catalog/count/url/controller
* @see client/html/catalog/count/url/action
* @see client/html/catalog/count/url/config
*/
$target = $config->get('client/html/catalog/count/url/target');
/** client/html/catalog/count/url/controller
* Name of the controller whose action should be called
*
* In Model-View-Controller (MVC) applications, the controller contains the methods
* that create parts of the output displayed in the generated HTML page. Controller
* names are usually alpha-numeric.
*
* @param string Name of the controller
* @since 2014.03
* @category Developer
* @see client/html/catalog/count/url/target
* @see client/html/catalog/count/url/action
* @see client/html/catalog/count/url/config
*/
$controller = $config->get('client/html/catalog/count/url/controller', 'catalog');
/** client/html/catalog/count/url/action
* Name of the action that should create the output
*
* In Model-View-Controller (MVC) applications, actions are the methods of a
* controller that create parts of the output displayed in the generated HTML page.
* Action names are usually alpha-numeric.
*
* @param string Name of the action
* @since 2014.03
* @category Developer
* @see client/html/catalog/count/url/target
* @see client/html/catalog/count/url/controller
* @see client/html/catalog/count/url/config
*/
$action = $config->get('client/html/catalog/count/url/action', 'count');
/** client/html/catalog/count/url/config
* Associative list of configuration options used for generating the URL
*
* You can specify additional options as key/value pairs used when generating
* the URLs, like
*
* client/html/<clientname>/url/config = array( 'absoluteUri' => true )
*
* The available key/value pairs depend on the application that embeds the e-commerce
* framework. This is because the infrastructure of the application is used for
* generating the URLs. The full list of available config options is referenced
* in the "see also" section of this page.
*
* @param string Associative list of configuration options
* @since 2014.03
* @category Developer
* @see client/html/catalog/count/url/target
* @see client/html/catalog/count/url/controller
* @see client/html/catalog/count/url/action
* @see client/html/url/config
*/
//.........这里部分代码省略.........
开发者ID:boettner-it,项目名称:aimeos-core,代码行数:101,代码来源:Standard.php
示例7: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$mediaItems = array();
$catPath = $view->get('stageCatPath', array());
foreach (array_reverse($catPath) as $catItem) {
$mediaItems = $catItem->getRefItems('media', 'default', 'stage');
if (!empty($mediaItems)) {
break;
}
}
$view->imageItems = $mediaItems;
$this->cache = $view;
}
return $this->cache;
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:24,代码来源:Standard.php
示例8: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$map = array();
$context = $this->getContext();
$config = $context->getConfig();
$locale = $context->getLocale();
/** client/html/locale/select/language/param-name
* Name of the parameter that contains the language ID value
*
* Frameworks and applications normally use its own predefined parameter
* that contains the current language ID if they are multi-language
* capable. To adapt the Aimeos parameter name to the already used name,
* you are able to configure it by using this setting.
*
* @param string Parameter name for language ID
* @since 2015.06
* @see client/html/locale/select/currency/param-name
*/
$langname = $config->get('client/html/locale/select/language/param-name', 'loc_languageid');
/** client/html/locale/select/currency/param-name
* Name of the parameter that contains the currency ID value
*
* Frameworks and applications normally use its own predefined parameter
* that contains the current currency ID if they already support multiple
* currencies. To adapt the Aimeos parameter name to the already used name,
* you are able to configure it by using this setting.
*
* @param string Parameter name for currency ID
* @since 2015.06
* @see client/html/locale/select/language/param-name
*/
$curname = $config->get('client/html/locale/select/currency/param-name', 'loc_currencyid');
$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
$search = $manager->createSearch(true);
$search->setSortations(array($search->sort('+', 'locale.position')));
foreach ($manager->searchItems($search) as $item) {
$curId = $item->getCurrencyId();
$langId = $item->getLanguageId();
$map[$langId][$curId] = array($langname => $langId, $curname => $curId);
}
$params = $view->param();
$view->selectMap = $map;
$view->selectParams = $params;
$view->selectLanguageId = $locale->getLanguageId();
$view->selectCurrencyId = $locale->getCurrencyId();
$this->cache = $view;
}
return $this->cache;
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:58,代码来源:Standard.php
示例9: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$input = $view->param('f_search');
$controller = \Aimeos\Controller\Frontend\Factory::createController($this->getContext(), 'catalog');
$filter = $controller->createTextFilter($input);
$items = $controller->getTextList($filter);
$suggestTextItems = array();
foreach ($items as $id => $name) {
$suggestTextItems[] = array("id" => $id, "name" => $name);
}
$view->suggestTextItems = $suggestTextItems;
$this->cache = $view;
}
return $this->cache;
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:24,代码来源:Standard.php
示例10: getProductListSort
/**
* Returns the sanitized sortation from the parameters for the product list.
*
* @param \Aimeos\MW\View\Iface $view View instance with helper for retrieving the required parameters
* @param string &$sortdir Value-result parameter where the sort direction will be stored
* @return string Sortation string (relevance, name, price)
*/
protected function getProductListSort(\Aimeos\MW\View\Iface $view, &$sortdir)
{
return $this->getProductListSortByParam($view->param(), $sortdir);
}
开发者ID:aimeos,项目名称:ai-client-html,代码行数:11,代码来源:Base.php
示例11: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$view->actionsParams = $this->getClientParams($view->param());
$view->actionsUserId = $this->getContext()->getUserId();
$this->cache = $view;
}
return $this->cache;
}
开发者ID:aimeos,项目名称:ai-client-html,代码行数:17,代码来源:Standard.php
示例12: getItems
/**
* Retrieves the item or items and adds the data to the view
*
* @param \Aimeos\MW\View\Iface $view View instance
* @return \Aimeos\MW\View\Iface View instance with additional data assigned
*/
protected function getItems(\Aimeos\MW\View\Iface $view)
{
$include = ($include = $view->param('include')) !== null ? explode(',', $include) : array();
$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog');
$search = $this->initCriteria($manager->createSearch(), $view->param());
$total = 1;
if (($id = $view->param('id')) == null) {
$view->data = $manager->searchItems($search, array(), $total);
$view->listItems = $this->getListItems($view->data, $include);
$view->childItems = $this->getChildItems($view->data, $include);
} else {
$view->data = $manager->getTree($id, array(), \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search);
$view->listItems = $this->getListItems(array($id => $view->data), $include);
$view->childItems = $this->getChildItems(array($view->data), $include);
}
$view->refItems = $this->getRefItems($view->listItems);
$view->total = $total;
return $view;
}
开发者ID:aimeos,项目名称:ai-admin-jsonadm,代码行数:25,代码来源:Standard.php
示例13: updateItems
/**
* Updates existing product download references or creates new ones
*
* @param \Aimeos\MW\View\Iface $view View object with helpers and assigned parameters
*/
protected function updateItems(\Aimeos\MW\View\Iface $view)
{
$id = $view->item->getId();
$context = $this->getContext();
$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
$attrManager = \Aimeos\MShop\Factory::createManager($context, 'attribute');
$listManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists');
$listItems = $manager->getItem($id, array('attribute'))->getListItems('attribute', 'hidden');
if (($listId = $view->param('download/product.lists.id')) !== null) {
if (!isset($listItems[$listId])) {
$litem = $this->createListItem($id);
$item = $this->createItem();
} else {
$litem = $listItems[$listId];
$item = $litem->getRefItem();
}
$item->setLabel($view->param('download/attribute.label'));
if (($file = $view->value($view->request()->getUploadedFiles(), 'download/file')) !== null) {
$item->setCode($this->storeFile($file));
}
$attrManager->saveItem($item);
$litem->setPosition(0);
$litem->setRefId($item->getId());
$listManager->saveItem($litem, false);
}
$this->cleanupItems($listItems, array($listId));
}
开发者ID:skyheights,项目名称:aimeos-core,代码行数:32,代码来源:Standard.php
示例14: setData
/**
* Returns the mapped input parameter or the existing items as expected by the template
*
* @param \Aimeos\MW\View\Iface $view View object with helpers and assigned parameters
*/
protected function setData(\Aimeos\MW\View\Iface $view)
{
$view->characteristicData = (array) $view->param('characteristic', array());
}
开发者ID:aimeos,项目名称:ai-admin-jqadm,代码行数:9,代码来源:Standard.php
示例15: updateItems
/**
* Updates existing product bundle references or creates new ones
*
* @param \Aimeos\MW\View\Iface $view View object with helpers and assigned parameters
*/
protected function updateItems(\Aimeos\MW\View\Iface $view)
{
$context = $this->getContext();
$manager = \Aimeos\MShop\Factory::createManager($context, 'product/lists');
$typeManager = \Aimeos\MShop\Factory::createManager($context, 'product/lists/type');
$item = $manager->createItem();
$item->setParentId($view->item->getId());
$item->setTypeId($typeManager->findItem('default', array(), 'product')->getId());
$item->setDomain('product');
$map = $this->getListItems($view->item->getId());
foreach ((array) $view->param('bundle/product.lists.id', array()) as $pos => $prodid) {
if (!isset($map[$prodid])) {
$item->setId(null);
$item->setRefId($prodid);
$item->setPosition($pos);
$manager->saveItem($item, false);
} else {
unset($map[$prodid]);
}
}
$manager->deleteItems($map);
}
开发者ID:mvnp,项目名称:aimeos-core,代码行数:27,代码来源:Standard.php
示例16: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
if (!isset($this->cache)) {
$salutations = array(\Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MRS, \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MISS);
try {
$salutation = '';
$addr = $view->extAddressItem;
if (in_array($addr->getSalutation(), $salutations)) {
$salutation = $view->translate('client/code', $addr->getSalutation());
}
/// E-mail intro with salutation (%1$s), first name (%2$s) and last name (%3$s)
$view->emailIntro = sprintf($view->translate('client', 'Dear %1$s %2$s %3$s'), $salutation, $addr->getFirstName(), $addr->getLastName());
} catch (\Exception $e) {
$view->emailIntro = $view->translate('client/html/email', 'Dear Sir or Madam');
}
$this->cache = $view;
}
return $this->cache;
}
开发者ID:aimeos,项目名称:ai-client-html,代码行数:27,代码来源:Standard.php
示例17: addUrl
/**
* Adds the "url" helper to the view object
*
* @param \Aimeos\MW\View\Iface $view View object
* @param \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder URL builder object
* @param \TYPO3\Flow\Mvc\RequestInterface|null $request Request object
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function addUrl(\Aimeos\MW\View\Iface $view, \TYPO3\Flow\Mvc\Routing\UriBuilder $uriBuilder, \TYPO3\Flow\Mvc\RequestInterface $request = null)
{
$fixed = array();
if ($request !== null) {
$params = $request->getArguments();
if (isset($params['site'])) {
$fixed['site'] = $params['site'];
}
if (isset($params['locale'])) {
$fixed['locale'] = $params['locale'];
}
if (isset($params['currency'])) {
$fixed['currency'] = $params['currency'];
}
}
$helper = new \Aimeos\MW\View\Helper\Url\Flow($view, $uriBuilder, $fixed);
$view->addHelper('url', $helper);
return $view;
}
开发者ID:aimeos,项目名称:aimeos-flow,代码行数:27,代码来源:View.php
示例18: updateItems
/**
* Updates existing product stock items or creates new ones
*
* @param \Aimeos\MW\View\Iface $view View object with helpers and assigned parameters
*/
protected function updateItems(\Aimeos\MW\View\Iface $view)
{
$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/stock');
$search = $manager->createSearch();
$search->setConditions($search->compare('==', 'product.stock.parentid', $view->item->getId()));
$items = $manager->searchitems($search);
$list = (array) $view->param('stock/product.stock.id', array());
foreach ($list as $idx => $id) {
if (!isset($items[$id])) {
$item = $manager->createItem();
} else {
$item = $items[$id];
}
$item->setParentId($view->item->getId());
$item->setWarehouseId($view->param('stock/product.stock.warehouseid/' . $idx));
$item->setStocklevel($view->param('stock/product.stock.stocklevel/' . $idx));
$item->setDateBack($view->param('stock/product.stock.dateback/' . $idx));
$manager->saveItem($item, false);
}
$manager->deleteItems(array_diff(array_keys($items), $list));
}
开发者ID:aimeos,项目名称:ai-admin-jqadm,代码行数:26,代码来源:Standard.php
示例19: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tags that are associated to the output
* @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
* @return \Aimeos\MW\View\Iface Modified view object
*/
protected function setViewParams(\Aimeos\MW\View\Iface $view, array &$tags = array(), &$expire = null)
{
/** client/html/email/logo
* Path to the logo image displayed in HTML e-mails
*
* The path can either be an absolute local path or an URL to a file on a
* remote server. If the file is stored on a remote server, "allow_url_fopen"
* must be enabled. See {@link http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen php.ini allow_url_fopen}
* documentation for details.
*
* @param string Absolute file system path or remote URL to the logo image
* @since 2014.03
* @category User
* @see client/html/email/from-email
*/
$file = $view->config('client/html/email/logo', 'client/html/themes/elegance/media/aimeos.png');
if (file_exists($file) && ($content = file_get_contents($file)) !== false) {
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mimetype = $finfo->file($file);
$view->htmlLogo = $view->mail()->embedAttachment($content, $mimetype, basename($file));
}
$path = $view->config('client/html/common/template/baseurl', 'client/html/themes/elegance');
$filepath = $path . DIRECTORY_SEPARATOR . 'common.css';
if (file_exists($filepath) && ($css = file_get_contents($filepath)) !== false) {
$view->htmlCss = $css;
}
return $view;
}
开发者ID:aimeos,项目名称:ai-client-html,代码行数:36,代码来源:Standard.php
示例20: setViewParams
/**
* Sets the necessary parameter values in the view.
*
* @param \Aimeos\MW\View\Iface $view The view object which generates the HTML output
* @param array &$tags Result array for the list of tag
|
请发表评论