/**
  * Loads selected article review information, returns name of template
  * file "article_review.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $this->_aViewData["edit"] = $oArticle = oxNew("oxarticle");
     $soxId = $this->getEditObjectId();
     $sRevoxId = oxConfig::getParameter('rev_oxid');
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         $oRevs = $this->_getReviewList($oArticle);
         foreach ($oRevs as $oRev) {
             if ($oRev->oxreviews__oxid->value == $sRevoxId) {
                 $oRev->selected = 1;
                 break;
             }
         }
         $this->_aViewData["allreviews"] = $oRevs;
         $this->_aViewData["editlanguage"] = $this->_iEditLang;
         if (isset($sRevoxId)) {
             $oReview = oxNew("oxreview");
             $oReview->load($sRevoxId);
             $this->_aViewData["editreview"] = $oReview;
             $oUser = oxNew("oxuser");
             $oUser->load($oReview->oxreviews__oxuserid->value);
             $this->_aViewData["user"] = $oUser;
         }
         //show "active" checkbox if moderating is active
         $this->_aViewData["blShowActBox"] = $myConfig->getConfigParam('blGBModerate');
     }
     return "article_review.tpl";
 }
Example #2
0
 /**
  * Executes parent method parent::render(), creates oxnews object and
  * passes news text to smarty. Returns name of template file "news_text.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $oNews = oxNew("oxnews");
         $iNewsLang = oxRegistry::getConfig()->getRequestParameter("newslang");
         if (!isset($iNewsLang)) {
             $iNewsLang = $this->_iEditLang;
         }
         $this->_aViewData["newslang"] = $iNewsLang;
         $oNews->loadInLang($iNewsLang, $soxId);
         foreach (oxRegistry::getLang()->getLanguageNames() as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
         // Disable editing for derived items.
         if ($oNews->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         $this->_aViewData["edit"] = $oNews;
     }
     $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 255, $oNews, "oxnews__oxlongdesc", "news.tpl.css");
     return "news_text.tpl";
 }
Example #3
0
 /**
  * Executes parent method parent::render(),
  * and returns name of template file
  * "object_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     if ($sType = $this->_getType()) {
         $oObject = oxNew($sType);
         if ($oObject->load($this->getEditObjectId())) {
             $oOtherLang = $oObject->getAvailableInLangs();
             if (!isset($oOtherLang[$iLang])) {
                 $oObject->loadInLang(key($oOtherLang), $this->getEditObjectId());
             }
             $this->_aViewData['edit'] = $oObject;
         }
         if ($oObject->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iLang = $this->getEditLang();
     $aLangs = oxRegistry::getLang()->getLanguageNames();
     foreach ($aLangs as $sLangId => $sLanguage) {
         $oLang = new stdClass();
         $oLang->sLangDesc = $sLanguage;
         $oLang->selected = $sLangId == $iLang;
         $this->_aViewData['otherlang'][$sLangId] = clone $oLang;
     }
     return 'object_seo.tpl';
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $sChosenArtCat = $this->_getCategoryTree("artcattree", oxConfig::getParameter("artcat"));
     // accessoires
     $sChosenArtCat2 = $this->_getCategoryTree("artcattree2", oxConfig::getParameter("artcat2"));
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_crossselling.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_accessories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDeliverysetPaymentAjax = oxNew('deliveryset_payment_ajax');
         $this->_aViewData['oxajax'] = $oDeliverysetPaymentAjax->getColumns();
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         $oDeliverysetCountryAjax = oxNew('deliveryset_country_ajax');
         $this->_aViewData['oxajax'] = $oDeliverysetCountryAjax->getColumns();
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
 /**
  * Executes parent method parent::render() and returns name of template
  * file "statistic_service.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $sSql = "select count(*) from oxlogs where oxshopid = '" . $this->getConfig()->getShopId() . "'";
     $this->_aViewData['iLogCount'] = oxDb::getDb()->getOne($sSql, false, false);
     return "statistic_service.tpl";
 }
Example #7
0
 /**
  * Executes parent method parent::render(), creates oxwrapping, oxshops and oxlist
  * objects, passes data to Smarty engine and returns name of template
  * file "wrapping_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $oWrapping = oxNew("oxwrapping");
         $oWrapping->loadInLang($this->_iEditLang, $soxId);
         $oOtherLang = $oWrapping->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $oWrapping->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $oWrapping;
         //Disable editing for derived articles
         if ($oWrapping->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // remove already created languages
         $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
         if (count($aLang)) {
             $this->_aViewData["posslang"] = $aLang;
         }
         foreach ($oOtherLang as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     return "wrapping_main.tpl";
 }
 /**
  * Executes parent method parent::render(), creates discount category tree,
  * passes data to Smarty engine and returns name of template file "discount_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if (isset($soxId) && $soxId != '-1') {
         // load object
         $oDiscount = oxNew('oxdiscount');
         $oDiscount->load($soxId);
         $this->_aViewData['edit'] = $oDiscount;
         //disabling derived items
         if ($oDiscount->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // generating category tree for artikel choose select list
         $this->_createCategoryTree("artcattree");
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDiscountArticlesAjax = oxNew('discount_articles_ajax');
         $this->_aViewData['oxajax'] = $oDiscountArticlesAjax->getColumns();
         return "popups/discount_articles.tpl";
     } elseif ($iAoc == 2) {
         $oDiscountCategoriesAjax = oxNew('discount_categories_ajax');
         $this->_aViewData['oxajax'] = $oDiscountCategoriesAjax->getColumns();
         return "popups/discount_categories.tpl";
     }
     return 'discount_articles.tpl';
 }
 /**
  * Executes parent method parent::render(), creates delivery category tree,
  * passes data to Smarty engine and returns name of template file "delivery_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     $sChosenArtCat2 = oxConfig::getParameter("artcat2");
     if ($soxId != "-1" && isset($soxId)) {
         $sChosenArtCat2 = $this->_getCategoryTree("artcattree", $sChosenArtCat2);
         // load object
         $oDelivery = oxNew("oxdelivery");
         $oDelivery->load($soxId);
         $this->_aViewData["edit"] = $oDelivery;
         //Disable editing for derived articles
         if ($oDelivery->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/delivery_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/delivery_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/delivery_categories.tpl";
     }
     return "delivery_articles.tpl";
 }
 /**
  * Executes parent method parent::render(), creates oxorder and
  * oxuserpayment objects, passes data to Smarty engine and returns
  * name of template file "order_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oOrder = oxNew("oxorder");
         $oOrder->load($soxId);
         // paid ?
         if ($oOrder->oxorder__oxpaid->value != "0000-00-00 00:00:00") {
             $oOrder->blIsPaid = true;
             $oOrder->oxorder__oxpaid = new oxField(oxUtilsDate::getInstance()->formatDBDate($oOrder->oxorder__oxpaid->value));
         }
         $this->_aViewData["edit"] = $oOrder;
         $this->_aViewData["paymentType"] = $oOrder->getPaymentType();
         $this->_aViewData["oShipSet"] = $oOrder->getShippingSetList();
         if ($oOrder->oxorder__oxdeltype->value) {
             // order user
             $oUser = oxNew('oxuser');
             $oUser->load($oOrder->oxorder__oxuserid->value);
             // order sum in default currency
             $dPrice = $oOrder->oxorder__oxtotalbrutsum->value / $oOrder->oxorder__oxcurrate->value;
             $this->_aViewData["oPayments"] = oxPaymentList::getInstance()->getPaymentList($oOrder->oxorder__oxdeltype->value, $dPrice, $oUser);
         }
         // any voucher used ?
         $this->_aViewData["aVouchers"] = $oOrder->getVoucherNrList();
     }
     $this->_aViewData["sNowValue"] = date("Y-m-d H:i:s", oxUtilsDate::getInstance()->getTime());
     return "order_main.tpl";
 }
 /**
  * Executes parent method parent::render(), creates delivery category tree,
  * passes data to Smarty engine and returns name of template file "delivery_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         $this->_createCategoryTree("artcattree");
         // load object
         $oDelivery = oxNew("oxdelivery");
         $oDelivery->load($soxId);
         $this->_aViewData["edit"] = $oDelivery;
         //Disable editing for derived articles
         if ($oDelivery->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oDeliveryArticlesAjax = oxNew('delivery_articles_ajax');
         $this->_aViewData['oxajax'] = $oDeliveryArticlesAjax->getColumns();
         return "popups/delivery_articles.tpl";
     } elseif ($iAoc == 2) {
         $oDeliveryCategoriesAjax = oxNew('delivery_categories_ajax');
         $this->_aViewData['oxajax'] = $oDeliveryCategoriesAjax->getColumns();
         return "popups/delivery_categories.tpl";
     }
     return "delivery_articles.tpl";
 }
 /**
  * Executes parent method parent::render(), creates discount category tree,
  * passes data to Smarty engine and returns name of template file "discount_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if ($soxId != '-1' && isset($soxId)) {
         // load object
         $oDiscount = oxNew('oxdiscount');
         $oDiscount->load($soxId);
         $this->_aViewData['edit'] = $oDiscount;
         //disabling derived items
         if ($oDiscount->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         // generating category tree for artikel choose select list
         $this->_getCategoryTree("artcattree", null);
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/discount_articles.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_articles.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/discount_categories.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/discount_categories.tpl";
     }
     return 'discount_articles.tpl';
 }
Example #13
0
 /**
  * Executes parent method parent::render(), creates oxlist object and
  * collects user groups information, passes data to Smarty engine,
  * returns name of template file "news_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     // all usergroups
     $oGroups = oxNew("oxlist");
     $oGroups->init("oxgroups");
     $oGroups->selectString("select * from " . getViewName("oxgroups", $this->_iEditLang));
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oNews = oxNew("oxnews");
         $oNews->loadInLang($this->_iEditLang, $soxId);
         $oOtherLang = $oNews->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $oNews->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $oNews;
         // remove already created languages
         $this->_aViewData["posslang"] = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
         foreach ($oOtherLang as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     if (oxRegistry::getConfig()->getRequestParameter("aoc")) {
         $oNewsMainAjax = oxNew('news_main_ajax');
         $this->_aViewData['oxajax'] = $oNewsMainAjax->getColumns();
         return "popups/news_main.tpl";
     }
     return "news_main.tpl";
 }
Example #14
0
 /**
  * Executes parent method parent::render(), creates oxCategoryList and
  * oxshop objects, passes it's data to Smarty engine and returns name of
  * template file "shop_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oShop = oxNew("oxshop");
         $isubjlang = oxRegistry::getConfig()->getRequestParameter("subjlang");
         if (!isset($isubjlang)) {
             $isubjlang = $this->_iEditLang;
         }
         if ($isubjlang && $isubjlang > 0) {
             $this->_aViewData["subjlang"] = $isubjlang;
         }
         $oShop->loadInLang($isubjlang, $soxId);
         $this->_aViewData["edit"] = $oShop;
         //oxSession::setVar( "actshop", $soxId);//echo "<h2>$soxId</h2>";
         oxRegistry::getSession()->setVariable("shp", $soxId);
     }
     $this->_aViewData['IsOXDemoShop'] = $myConfig->isDemoShop();
     if (!isset($this->_aViewData['updatenav'])) {
         $this->_aViewData['updatenav'] = oxRegistry::getConfig()->getRequestParameter('updatenav');
     }
     return "shop_main.tpl";
 }
Example #15
0
 /**
  * Executes parent method parent::render(), creates oxCategoryList object,
  * passes it's data to Smarty engine and returns name of template file
  * "selectlist_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $oCountry = oxNew("oxcountry");
         $oCountry->loadInLang($this->_iEditLang, $soxId);
         if ($oCountry->isForeignCountry()) {
             $this->_aViewData["blForeignCountry"] = true;
         } else {
             $this->_aViewData["blForeignCountry"] = false;
         }
         $oOtherLang = $oCountry->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $oCountry->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $oCountry;
         // remove already created languages
         $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
         if (count($aLang)) {
             $this->_aViewData["posslang"] = $aLang;
         }
         foreach ($oOtherLang as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     } else {
         $this->_aViewData["blForeignCountry"] = true;
     }
     return "country_main.tpl";
 }
 /**
  * Executes parent method parent::render(), creates deliveryset category tree,
  * passes data to Smarty engine and returns name of template file "deliveryset_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->loadInLang($this->_iEditLang, $soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         // remove already created languages
         $aLang = array_diff(oxLang::getInstance()->getLanguageNames(), $oOtherLang);
         if (count($aLang)) {
             $this->_aViewData["posslang"] = $aLang;
         }
         foreach ($oOtherLang as $id => $language) {
             $oLang = new oxStdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     if (oxConfig::getParameter("aoc")) {
         $aColumns = array();
         include_once 'inc/' . strtolower(__CLASS__) . '.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_main.tpl";
     }
     return "deliveryset_main.tpl";
 }
 /**
  * Executes parent method parent::render(), creates oxnews object and
  * passes news text to smarty. Returns name of template file "news_text.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oNews = oxNew("oxnews");
         $iNewsLang = oxConfig::getParameter("newslang");
         if (!isset($iNewsLang)) {
             $iNewsLang = $this->_iEditLang;
         }
         $this->_aViewData["newslang"] = $iNewsLang;
         $oNews->loadInLang($iNewsLang, $soxId);
         foreach (oxLang::getInstance()->getLanguageNames() as $id => $language) {
             $oLang = new oxStdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
         $this->_aViewData["edit"] = $oNews;
     }
     $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 255, $oNews, "oxnews__oxlongdesc", "news.tpl.css");
     return "news_text.tpl";
 }
Example #18
0
 /**
  * Sets link information data (or leaves empty), returns name of template
  * file "adminlinks_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oLinks = oxNew("oxlinks", getViewName('oxlinks'));
         $oLinks->loadInLang($this->_iEditLang, $soxId);
         $oOtherLang = $oLinks->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $oLinks->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $oLinks;
         // remove already created languages
         $this->_aViewData["posslang"] = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
         foreach ($oOtherLang as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     // generate editor
     $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 255, $oLinks, "oxlinks__oxurldesc", "links.tpl.css");
     return "adminlinks_main.tpl";
 }
 /**
  * Collects article crosselling and attributes information, passes
  * them to Smarty engine and returns name or template file
  * "article_crossselling.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     // crossselling
     $this->_createCategoryTree("artcattree");
     // accessoires
     $this->_createCategoryTree("artcattree2");
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
     if ($iAoc == 1) {
         $oArticleCrossellingAjax = oxNew('article_crossselling_ajax');
         $this->_aViewData['oxajax'] = $oArticleCrossellingAjax->getColumns();
         return "popups/article_crossselling.tpl";
     } elseif ($iAoc == 2) {
         $oArticleAccessoriesAjax = oxNew('article_accessories_ajax');
         $this->_aViewData['oxajax'] = $oArticleAccessoriesAjax->getColumns();
         return "popups/article_accessories.tpl";
     }
     return "article_crossselling.tpl";
 }
Example #20
0
 /**
  * Executes parent method parent::render(), creates oxuser and oxbase objects,
  * passes data to Smarty engine and returns name of template file
  * "user_address.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oUser = oxNew("oxuser");
         $oUser->load($soxId);
         // load adress
         $sAddressIdParameter = oxRegistry::getConfig()->getRequestParameter("oxaddressid");
         $soxAddressId = isset($this->sSavedOxid) ? $this->sSavedOxid : $sAddressIdParameter;
         if ($soxAddressId != "-1" && isset($soxAddressId)) {
             $oAdress = oxNew("oxaddress");
             $oAdress->load($soxAddressId);
             $this->_aViewData["edit"] = $oAdress;
         }
         $this->_aViewData["oxaddressid"] = $soxAddressId;
         // generate selected
         $oAddressList = $oUser->getUserAddresses();
         foreach ($oAddressList as $oAddress) {
             if ($oAddress->oxaddress__oxid->value == $soxAddressId) {
                 $oAddress->selected = 1;
                 break;
             }
         }
         $this->_aViewData["edituser"] = $oUser;
     }
     $oCountryList = oxNew("oxCountryList");
     $oCountryList->loadActiveCountries(oxRegistry::getLang()->getObjectTplLanguage());
     $this->_aViewData["countrylist"] = $oCountryList;
     if (!$this->_allowAdminEdit($soxId)) {
         $this->_aViewData['readonly'] = true;
     }
     return "user_address.tpl";
 }
Example #21
0
 /**
  * Executes parent method parent::render(), creates oxuser, oxlist and
  * oxRemark objects, passes data to Smarty engine and returns name of
  * template file "user_remark.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->getEditObjectId();
     $sRemoxId = oxRegistry::getConfig()->getRequestParameter("rem_oxid");
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oUser = oxNew("oxuser");
         $oUser->load($soxId);
         $this->_aViewData["edit"] = $oUser;
         // all remark
         $oRems = oxNew("oxlist");
         $oRems->init("oxremark");
         $sQuotedUserId = oxDb::getDb()->quote($oUser->getId());
         $sSelect = "select * from oxremark where oxparentid=" . $sQuotedUserId . " order by oxcreate desc";
         $oRems->selectString($sSelect);
         foreach ($oRems as $key => $val) {
             if ($val->oxremark__oxid->value == $sRemoxId) {
                 $val->selected = 1;
                 $oRems[$key] = $val;
                 break;
             }
         }
         $this->_aViewData["allremark"] = $oRems;
         if (isset($sRemoxId)) {
             $oRemark = oxNew("oxRemark");
             $oRemark->load($sRemoxId);
             $this->_aViewData["remarktext"] = $oRemark->oxremark__oxtext->value;
             $this->_aViewData["remarkheader"] = $oRemark->oxremark__oxheader->value;
         }
     }
     return "user_remark.tpl";
 }
 /**
  * Collects article attributes and selection lists, passes them to Smarty engine,
  * returns name of template file "article_attribute.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oArticle = oxNew('oxarticle');
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oArticle->load($soxId);
         if ($oArticle->isDerived()) {
             $this->_aViewData["readonly"] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/article_attribute.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_attribute.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/article_selection.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/article_selection.tpl";
     }
     return "article_attribute.tpl";
 }
 public function render()
 {
     parent::render();
     $aResult = $this->_getModuleManager()->getResultFile();
     $this->addTplParam('aModules', $aResult);
     return $this->_sThisTemplate;
 }
Example #24
0
 /**
  * Executes parent method parent::render(), creates oxgroups object,
  * passes data to Smarty engine and returns name of template file
  * "usergroup_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $oGroup = oxNew("oxgroups");
         $oGroup->loadInLang($this->_iEditLang, $soxId);
         $oOtherLang = $oGroup->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $oGroup->loadInLang(key($oOtherLang), $soxId);
         }
         $this->_aViewData["edit"] = $oGroup;
         // remove already created languages
         $aLang = array_diff(oxRegistry::getLang()->getLanguageNames(), $oOtherLang);
         if (count($aLang)) {
             $this->_aViewData["posslang"] = $aLang;
         }
         foreach ($oOtherLang as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     if (oxRegistry::getConfig()->getRequestParameter("aoc")) {
         $oUsergroupMainAjax = oxNew('usergroup_main_ajax');
         $this->_aViewData['oxajax'] = $oUsergroupMainAjax->getColumns();
         return "popups/usergroup_main.tpl";
     }
     return "usergroup_main.tpl";
 }
Example #25
0
 /**
  * Executes parent method parent::render(), creates oxCategoryList and
  * oxshop objects, passes it's data to Smarty engine and returns name of
  * template file "shop_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $config = $this->getConfig();
     parent::render();
     $shopId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     $templateName = $this->renderNewShop();
     if ($templateName) {
         return $templateName;
     }
     $user = $this->getUser();
     $shopId = $this->updateShopIdByUser($user, $shopId, true);
     if (isset($shopId) && $shopId != self::NEW_SHOP_ID) {
         // load object
         $shop = oxNew("oxshop");
         $subjLang = oxRegistry::getConfig()->getRequestParameter("subjlang");
         if (!isset($subjLang)) {
             $subjLang = $this->_iEditLang;
         }
         if ($subjLang && $subjLang > 0) {
             $this->_aViewData["subjlang"] = $subjLang;
         }
         $shop->loadInLang($subjLang, $shopId);
         $this->_aViewData["edit"] = $shop;
         //oxSession::setVar( "actshop", $soxId);//echo "<h2>$soxId</h2>";
         oxRegistry::getSession()->setVariable("shp", $shopId);
     }
     $this->checkParent($shop);
     $this->_aViewData['IsOXDemoShop'] = $config->isDemoShop();
     if (!isset($this->_aViewData['updatenav'])) {
         $this->_aViewData['updatenav'] = oxRegistry::getConfig()->getRequestParameter('updatenav');
     }
     return "shop_main.tpl";
 }
Example #26
0
 /**
  * Loads category object data, pases it to Smarty engine and returns
  * name of template file "category_text.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $this->_aViewData['edit'] = $oCategory = oxNew('oxCategory');
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if (isset($soxId) && $soxId != "-1") {
         // load object
         $iCatLang = oxRegistry::getConfig()->getRequestParameter("catlang");
         if (!isset($iCatLang)) {
             $iCatLang = $this->_iEditLang;
         }
         $this->_aViewData["catlang"] = $iCatLang;
         $oCategory->loadInLang($iCatLang, $soxId);
         //Disable editing for derived items
         if ($oCategory->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
         foreach (oxRegistry::getLang()->getLanguageNames() as $id => $language) {
             $oLang = new stdClass();
             $oLang->sLangDesc = $language;
             $oLang->selected = $id == $this->_iEditLang;
             $this->_aViewData["otherlang"][$id] = clone $oLang;
         }
     }
     $this->_aViewData["editor"] = $this->_generateTextEditor("100%", 300, $oCategory, "oxcategories__oxlongdesc", "list.tpl.css");
     return "category_text.tpl";
 }
 /**
  * Executes parent method parent::render()
  * passes data to Smarty engine and returns name of template file "deliveryset_payment.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $odeliveryset = oxNew("oxdeliveryset");
         $odeliveryset->setLanguage($this->_iEditLang);
         $odeliveryset->load($soxId);
         $oOtherLang = $odeliveryset->getAvailableInLangs();
         if (!isset($oOtherLang[$this->_iEditLang])) {
             // echo "language entry doesn't exist! using: ".key($oOtherLang);
             $odeliveryset->setLanguage(key($oOtherLang));
             $odeliveryset->load($soxId);
         }
         $this->_aViewData["edit"] = $odeliveryset;
         //Disable editing for derived articles
         if ($odeliveryset->isDerived()) {
             $this->_aViewData['readonly'] = true;
         }
     }
     $aColumns = array();
     $iAoc = oxConfig::getParameter("aoc");
     if ($iAoc == 1) {
         include_once 'inc/deliveryset_payment.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_payment.tpl";
     } elseif ($iAoc == 2) {
         include_once 'inc/deliveryset_country.inc.php';
         $this->_aViewData['oxajax'] = $aColumns;
         return "popups/deliveryset_country.tpl";
     }
     return "deliveryset_payment.tpl";
 }
Example #28
0
 /**
  * Executes parent method parent::render(), creates oxpricealarm object
  * and passes it's data to Smarty engine. Returns name of template file
  * "pricealarm_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     $config = $this->getConfig();
     parent::render();
     $shopId = $config->getShopId();
     //articles price in subshop and baseshop can be different
     $this->_aViewData['iAllCnt'] = 0;
     $query = "\n            SELECT oxprice, oxartid\n            FROM oxpricealarm\n            WHERE oxsended = '000-00-00 00:00:00' AND oxshopid = '{$shopId}' ";
     $result = oxDb::getDb()->select($query);
     if ($result != false && $result->count() > 0) {
         $simpleCache = array();
         while (!$result->EOF) {
             $price = $result->fields[0];
             $articleId = $result->fields[1];
             if (isset($simpleCache[$articleId])) {
                 if ($simpleCache[$articleId] <= $price) {
                     $this->_aViewData['iAllCnt'] += 1;
                 }
             } else {
                 $article = oxNew("oxArticle");
                 if ($article->load($articleId)) {
                     $articlePrice = $simpleCache[$articleId] = $article->getPrice()->getBruttoPrice();
                     if ($articlePrice <= $price) {
                         $this->_aViewData['iAllCnt'] += 1;
                     }
                 }
             }
             $result->fetchRow();
         }
     }
     return "pricealarm_mail.tpl";
 }
 /**
  * Executes parent method parent::render(), creates oxOrder, passes
  * it's data to Smarty engine and returns name of template file
  * "order_overview.tpl".
  *
  * @return string
  */
 public function render()
 {
     $myConfig = $this->getConfig();
     parent::render();
     $oOrder = oxNew("oxOrder");
     $oCur = $myConfig->getActShopCurrencyObject();
     $oLang = oxRegistry::getLang();
     $soxId = $this->getEditObjectId();
     if ($soxId != "-1" && isset($soxId)) {
         // load object
         $oOrder->load($soxId);
         $this->_aViewData["edit"] = $oOrder;
         $this->_aViewData["aProductVats"] = $oOrder->getProductVats();
         $this->_aViewData["orderArticles"] = $oOrder->getOrderArticles();
         $this->_aViewData["giftCard"] = $oOrder->getGiftCard();
         $this->_aViewData["paymentType"] = $this->_getPaymentType($oOrder);
         $this->_aViewData["deliveryType"] = $oOrder->getDelSet();
         $sTsProtectsField = 'oxorder__oxtsprotectcosts';
         if ($oOrder->{$sTsProtectsField}->value) {
             $this->_aViewData["tsprotectcosts"] = $oLang->formatCurrency($oOrder->{$sTsProtectsField}->value, $oCur);
         }
     }
     // orders today
     $dSum = $oOrder->getOrderSum(true);
     $this->_aViewData["ordersum"] = $oLang->formatCurrency($dSum, $oCur);
     $this->_aViewData["ordercnt"] = $oOrder->getOrderCnt(true);
     // ALL orders
     $dSum = $oOrder->getOrderSum();
     $this->_aViewData["ordertotalsum"] = $oLang->formatCurrency($dSum, $oCur);
     $this->_aViewData["ordertotalcnt"] = $oOrder->getOrderCnt();
     $this->_aViewData["afolder"] = $myConfig->getConfigParam('aOrderfolder');
     $this->_aViewData["alangs"] = $oLang->getLanguageNames();
     $this->_aViewData["currency"] = $oCur;
     return "order_overview.tpl";
 }
 /**
  * Loads article Mercators info, passes it to Smarty engine and
  * returns name of template file "Mercator_main.tpl".
  *
  * @return string
  */
 public function render()
 {
     parent::render();
     $oSysReq = new oxSysRequirements();
     $this->_aViewData['aInfo'] = $oSysReq->getSystemInfo();
     $this->_aViewData['aCollations'] = $oSysReq->checkCollation();
     return "sysreq_main.tpl";
 }