Adds article to selected recommendation list

@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.

@return null
194390
public function addToRecomm()
    {
        if (!\OxidEsales\Eshop\Core\Registry::getSession()->checkSessionChallenge()) {
            return;
        }

        if (!$this->getViewConfig()->getShowListmania()) {
            return;
        }

        $recommendationText = trim(( string ) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm_txt'));
        $recommendationListId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('recomm');
        $articleId = $this->getProduct()->getId();

        if ($articleId) {
            $recommendationList = oxNew(\OxidEsales\Eshop\Application\Model\RecommendationList::class);
            $recommendationList->load($recommendationListId);
            $recommendationList->addArticle($articleId, $recommendationText);
        }
    }
477601
public function add() {
        $cmsContentMeta = $this->CmsContentMeta->newEntity();
        if ($this->request->is('post')) {
            $cmsContentMeta = $this->CmsContentMeta->patchEntity($cmsContentMeta, $this->request->data);
            if ($this->CmsContentMeta->save($cmsContentMeta)) {
                $this->Flash->success('The cms content meta has been saved.');
                return $this->redirect(['action' => 'index']);
            } else {
                $this->Flash->error('The cms content Meta could not be saved. Please, try again.');
            }
        }
        $cmsContent = $this->CmsContentMeta->CmsContent->find('list', ['limit' => 200]);
        $this->set(compact('cmsContentMeta', 'cmsContent'));
        $this->set('_serialize', ['cmsContentMeta']);
    }
172398
public function addCatToAttr()
    {
        $aAddCategory = $this->_getActionIds('oxcategories.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        $oAttribute = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);
        // adding
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sCatTable = $this->_getViewName('oxcategories');
            $aAddCategory = $this->_getAll($this->_addFilter("select $sCatTable.oxid " . $this->_getQuery()));
        }

        if ($oAttribute->load($soxId) && is_array($aAddCategory)) {
            // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804 and ESDEV-3822).
            $database = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
            foreach ($aAddCategory as $sAdd) {
                $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oNewGroup->init("oxcategory2attribute");
                $sOxSortField = 'oxcategory2attribute__oxsort';
                $sObjectIdField = 'oxcategory2attribute__oxobjectid';
                $sAttributeIdField = 'oxcategory2attribute__oxattrid';
                $sOxIdField = 'oxattribute__oxid';
                $oNewGroup->$sObjectIdField = new \OxidEsales\Eshop\Core\Field($sAdd);
                $oNewGroup->$sAttributeIdField = new \OxidEsales\Eshop\Core\Field($oAttribute->$sOxIdField->value);

                $sSql = "select max(oxsort) + 1 from oxcategory2attribute where oxobjectid = '$sAdd' ";

                $oNewGroup->$sOxSortField = new \OxidEsales\Eshop\Core\Field(( int ) $database->getOne($sSql));
                $oNewGroup->save();
            }
        }

        $this->resetContentCache();
    }
1048285
private function AddCategoryField()       
    {
        $name = 'Category';
        $value = '';
        if ($this->article->Exists()) {
            $value = $this->article->GetCategory()->GetID();
        }
        $field = new Select($name, $value);
        $field->AddOption('', Trans('Core.PleaseSelect'));
        $catList = new CategoryListProvider($this->archive);
        $categories = $catList->ToArray();
        foreach ($categories as $category) {
            $field->AddOption($category->GetID(), $category->GetName());
        }
        $this->AddField($field);
        $this->SetRequired($name);
    }
997598
protected function LoadArticleList()
    {
        if (is_null($this->oList)) {
            parent::LoadArticleList();
            if (!is_null($this->oList) && '1' == $this->global->GetUserData(TdbPkgShopListfilter::URL_PARAMETER_IS_NEW_REQUEST)) {
                TdbShop::ResetAllRegisteredActiveVariantsForAllSpots();
                $this->iPage = 0;
                $this->oList->RestorePagingInfoFromSession($this->iPageSize * $this->iPage, $this->iPageSize);
                $this->oList->JumpToPage(0);
            }
        }
    }
1337438
protected function addCategory()
    {
        if (!$this->isError()) {
            $id = $this->category->add($this->getSubmitted());
            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }
            $this->line($id);
        }
    }
267956
public function addListCommands()
    {
        $entity = $this->getController()->getItem();

        if ($entity->authorize('vote')) {
            $this->addCommand('vote');
        }

        if ($entity->authorize('edit')) {
            $this->addCommand('edit', array('layout' => 'form'))
            ->getCommand('edit')
            ->setAttribute('data-action', 'edit');

            $this->addCommand('enable', array('ajax' => true));
        }

        if ($entity->authorize('delete') && $this->getController()->filter != 'leaders') {
            $this->addCommand('delete');
        }
    }
888837
protected function LoadArticleList()
    {
        if (is_null($this->oList)) {
            $iListIdent = $this->global->GetUserData(TdbShopArticleList::URL_LIST_KEY_NAME);
            if ($iListIdent) {
                $this->oList = TdbShopArticleList::GetInstanceFromSession($iListIdent);
            }
            if (is_null($this->oList)) {
                $oActiveCategory = self::GetActiveCategory();
                /** @var $oActiveCategory TdbShopCategory */
                $sOrderListBy = $this->GetActiveOrderByString($this->iActiveShopModuleArticlelistOrderbyId);
                if (!is_null($oActiveCategory)) {
                    if ($this->oModuleConf->fieldShowSubcategoryProducts) {
                        $this->oList = $oActiveCategory->GetArticleListIncludingSubcategories($sOrderListBy, $this->aFilter);
                    } else {
                        $this->oList = $oActiveCategory->GetArticleList($sOrderListBy, $this->aFilter);
                    }
                } else {
                    $this->oList = $this->getListWhenNoCategoryDefined($sOrderListBy, $this->aFilter);
                }
            }

            $this->PostLoadArticleListHook();

            if (!is_null($this->oList)) {
                $this->oList->RestorePagingInfoFromSession($this->iPageSize * $this->iPage, $this->iPageSize);

                $sRequest = $this->global->GetUserData(TdbShopArticleList::URL_LIST_REQUEST);
                $this->oList->HandleURLRequest($sRequest, true);
            }
        }
    }
1347619
public function actionAdd() 
	{
		$model=new OmmuPages;

		// Uncomment the following line if AJAX validation is needed
		$this->performAjaxValidation($model);

		if(isset($_POST['OmmuPages'])) {
			$model->attributes=$_POST['OmmuPages'];
			
			if($model->save()) {
				Yii::app()->user->setFlash('success', Yii::t('phrase', 'Pages success created.'));
				$this->redirect(array('manage'));
			}
		}

		$this->pageTitle = Yii::t('phrase', 'Add Page');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('admin_add', array(
			'model'=>$model,
		));
	}
804893
public function addMetaBoxes()
    {
        // Publish
        add_meta_box(
            'modularity-mb-editor-publish',
            __('Save modules', 'modularity'),
            function () {
                include MODULARITY_TEMPLATE_PATH . 'editor/modularity-publish.php';
            },
            $this->screenHook,
            'side'
        );

        // Modules
        add_meta_box(
            'modularity-mb-modules',
            __('Enabled modules', 'modularity'),
            function () {
                $enabled = \Modularity\ModuleManager::$enabled;
                $available = \Modularity\ModuleManager::$available;
                $deprecated = \Modularity\ModuleManager::$deprecated;

                $modules = array();
                if (is_array($enabled) && !empty($enabled)) {
                    foreach ($enabled as $module) {
                        if (isset($available[$module]) && !in_array($module, $deprecated)) {
                            $modules[$module] = apply_filters('Modularity/Editor/SidebarIncompability', $available[$module], $module);
                        }
                    }
                }

                uasort($modules, function ($a, $b) {
                    return $a['labels']['name'] > $b['labels']['name'];
                });

                include MODULARITY_TEMPLATE_PATH . 'editor/modularity-enabled-modules.php';
            },
            $this->screenHook,
            'side'
        );

        $this->addSidebarsMetaBoxes();
    }
754698
public function add()
    {
        $entity = $this->Dblists->newEntity();
        if ($this->request->is('post')) {
            $entity = $this->Dblists->patchEntity($entity, (array)$this->request->getData());
            if ($this->Dblists->save($entity)) {
                $this->Flash->success('The database list has been saved.');

                return $this->redirect(['action' => 'index']);
            }

            $this->Flash->error('The database list could not be saved. Please, try again.');
        }

        $this->set(compact('entity'));
        $this->set('_serialize', ['entity']);
    }
963931
public function getArticleList()
    {
        if ($this->_aArticleList === null) {
            $this->_aArticleList = [];
            if (($oVendor = $this->getActVendor()) && ($oVendor->getId() != 'root')) {
                list($aArticleList, $iAllArtCnt) = $this->_loadArticles($oVendor);
                if ($iAllArtCnt) {
                    $this->_aArticleList = $aArticleList;
                }
            }
        }

        return $this->_aArticleList;
    }
357184
public function getTopArticleList()
    {
        if ($this->_aTopArticleList === null) {
            $this->_aTopArticleList = false;
            if ($this->_getLoadActionsParam()) {
                // start list
                $oArtList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
                $oArtList->loadActionArticles('OXTOPSTART');
                if ($oArtList->count()) {
                    $this->_aTopArticleList = $oArtList;
                }
            }
        }

        return $this->_aTopArticleList;
    }
1153845
public function addField()
    {
        $oSelectlist = oxNew(\OxidEsales\Eshop\Application\Model\SelectList::class);
        if ($oSelectlist->loadInLang($this->_iEditLang, $this->getEditObjectId())) {
            //Disable editing for derived items.
            if ($oSelectlist->isDerived()) {
                return;
            }

            $sAddField = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddField");
            if (empty($sAddField)) {
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iErrorCode", ERR_REQUIREDMISSING);

                return;
            }

            $this->aFieldArray = \OxidEsales\Eshop\Core\Registry::getUtils()->assignValuesFromText($oSelectlist->oxselectlist__oxvaldesc->getRawValue());

            $oField = new stdClass();
            $oField->name = $sAddField;
            $oField->price = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceMod");
            $oField->priceUnit = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPriceModUnit");

            $this->aFieldArray[] = $oField;
            if ($iPos = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("sAddFieldPos")) {
                if ($this->_rearrangeFields($oField, $iPos - 1)) {
                    return;
                }
            }

            $this->save();
        }
    }
1355189
public function getSelectionList()
    {
        if ($this->_aSelectionList === null) {
            $this->_aSelectionList = [];

            $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            $oProduct->load($this->getEditObjectId());

            if ($oCatList = $this->_getCategoryList($oProduct)) {
                $this->_aSelectionList["oxcategory"][$this->_iEditLang] = $oCatList;
            }

            if ($oVndList = $this->_getVendorList($oProduct)) {
                $this->_aSelectionList["oxvendor"][$this->_iEditLang] = $oVndList;
            }

            if ($oManList = $this->_getManufacturerList($oProduct)) {
                $this->_aSelectionList["oxmanufacturer"][$this->_iEditLang] = $oManList;
            }
        }

        return $this->_aSelectionList;
    }
726890
private function AddMetaTitlePlacementField()
    {
        $name = 'MetaTitlePlacement';
        $value = $this->archive->GetMetaTitlePlacement() ?: MetaPlacement::Prepend()->Value();
        $this->AddMetaPlacementSelect($name, $value);
    }
166039
protected function wizardAddCategory()
    {
        // Required
        $this->validatePrompt('title', $this->text('Title'), 'category');
        $this->validatePrompt('category_group_id', $this->text('Category group ID'), 'category');

        // Optional
        $this->validatePrompt('parent_id', $this->text('Parent category ID'), 'category', 0);
        $this->validatePrompt('description_1', $this->text('First description'), 'category', '');
        $this->validatePrompt('description_2', $this->text('Second description'), 'category', '');
        $this->validatePrompt('meta_title', $this->text('Meta title'), 'category', '');
        $this->validatePrompt('meta_description', $this->text('Meta description'), 'category', '');
        $this->validatePrompt('status', $this->text('Status'), 'category', 0);
        $this->validatePrompt('weight', $this->text('Weight'), 'category', 0);

        $this->validateComponent('category');
        $this->addCategory();
    }