本文整理汇总了PHP中getViewName函数的典型用法代码示例。如果您正苦于以下问题:PHP getViewName函数的具体用法?PHP getViewName怎么用?PHP getViewName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getViewName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* 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";
}
示例2: getIdByName
/**
* returns delivery set id
*
* @param string $sTitle delivery name
*
* @return string
*/
public function getIdByName($sTitle)
{
$oDb = oxDb::getDb();
$sQ = "SELECT `oxid` FROM `" . getViewName('oxdeliveryset') . "` WHERE `oxtitle` = " . $oDb->quote($sTitle);
$sId = $oDb->getOne($sQ);
return $sId;
}
示例3: _prepareWhereQuery
/**
* Adds active promotion check
*
* @param array $aWhere SQL condition array
* @param string $sqlFull SQL query string
*
* @return $sQ
*/
protected function _prepareWhereQuery($aWhere, $sqlFull)
{
$sQ = parent::_prepareWhereQuery($aWhere, $sqlFull);
$sDisplayType = (int) oxRegistry::getConfig()->getRequestParameter('displaytype');
$sTable = getViewName("oxactions");
//searchong for empty oxfolder fields
if ($sDisplayType) {
$sNow = date('Y-m-d H:i:s', oxRegistry::get("oxUtilsDate")->getTime());
switch ($sDisplayType) {
case 1:
// active
$sQ .= " and {$sTable}.oxactivefrom < '{$sNow}' and {$sTable}.oxactiveto > '{$sNow}' ";
break;
case 2:
// upcoming
$sQ .= " and {$sTable}.oxactivefrom > '{$sNow}' ";
break;
case 3:
// expired
$sQ .= " and {$sTable}.oxactiveto < '{$sNow}' and {$sTable}.oxactiveto != '0000-00-00 00:00:00' ";
break;
}
}
return $sQ;
}
示例4: getVoucherByNr
/**
* Gets voucher from db by given number.
*
* @param string $sVoucherNr Voucher number
* @param array $aVouchers Array of available vouchers (default array())
* @param bool $blCheckavalability check if voucher is still reserver od not
*
* @throws oxVoucherException exception
*
* @return mixed
*/
public function getVoucherByNr($sVoucherNr, $aVouchers = array(), $blCheckavalability = false)
{
$oRet = null;
if (!empty($sVoucherNr)) {
$sViewName = $this->getViewName();
$sSeriesViewName = getViewName('oxvoucherseries');
$oDb = oxDb::getDb();
$sQ = "select {$sViewName}.* from {$sViewName}, {$sSeriesViewName} where\n {$sSeriesViewName}.oxid = {$sViewName}.oxvoucherserieid and\n {$sViewName}.oxvouchernr = " . $oDb->quote($sVoucherNr) . " and ";
if (is_array($aVouchers)) {
foreach ($aVouchers as $sVoucherId => $sSkipVoucherNr) {
$sQ .= "{$sViewName}.oxid != " . $oDb->quote($sVoucherId) . " and ";
}
}
$sQ .= "( {$sViewName}.oxorderid is NULL || {$sViewName}.oxorderid = '' ) ";
$sQ .= " and ( {$sViewName}.oxdateused is NULL || {$sViewName}.oxdateused = 0 ) ";
//voucher timeout for 3 hours
if ($blCheckavalability) {
$iTime = time() - $this->_getVoucherTimeout();
$sQ .= " and {$sViewName}.oxreserved < '{$iTime}' ";
}
$sQ .= " limit 1";
if (!($oRet = $this->assignRecord($sQ))) {
$oEx = oxNew('oxVoucherException');
$oEx->setMessage('ERROR_MESSAGE_VOUCHER_NOVOUCHER');
$oEx->setVoucherNr($sVoucherNr);
throw $oEx;
}
}
return $oRet;
}
示例5: getTitleById
/**
* Get state title by id
*
* @param integer|string $iStateId
*
* @return string
*/
public function getTitleById($iStateId)
{
$oDb = oxDb::getDb();
$sQ = "SELECT oxtitle FROM " . getViewName("oxstates") . " WHERE oxid = " . $oDb->quote($iStateId);
$sStateTitle = $oDb->getOne($sQ);
return (string) $sStateTitle;
}
示例6: load
/**
* Selects and loads all address for particular user.
*
* @param string $sUserId user id
*/
public function load($sUserId)
{
$sViewName = getViewName('oxcountry');
$oBaseObject = $this->getBaseObject();
$sSelectFields = $oBaseObject->getSelectFields();
$sSelect = "\n SELECT {$sSelectFields}, `oxcountry`.`oxtitle` AS oxcountry\n FROM oxaddress\n LEFT JOIN {$sViewName} AS oxcountry ON oxaddress.oxcountryid = oxcountry.oxid\n WHERE oxaddress.oxuserid = " . oxDb::getDb()->quote($sUserId);
$this->selectString($sSelect);
}
示例7: testDescWithHtmlEntity
/**
* tests save function with special chars
*/
public function testDescWithHtmlEntity()
{
$oLink = oxNew("oxlinks", getViewName('oxlinks'));
$oLink->load($this->_oxLinks->getId());
$oLink->oxlinks__oxurldesc = new oxField('Link&, &, !@#$%^&*%$$&@\'.,;p"äüßö', oxField::T_RAW);
$this->_oxLinks->Save();
$this->assertEquals('Link&, &, !@#$%^&*%$$&@\'.,;p"äüßö', $oLink->oxlinks__oxurldesc->value);
}
示例8: _buildSelectString
/**
* Builds and returns SQL query string. Adds additional order check.
*
* @param object $oListObject list main object.
*
* @return string
*/
protected function _buildSelectString($oListObject = null)
{
$sSql = parent::_buildSelectString($oListObject);
$sPaymentTable = getViewName("oxpayments");
$sQ = ", `oepaypal_order`.`oepaypal_paymentstatus`, `payments`.`oxdesc` as `paymentname` from `oxorder`\n LEFT JOIN `oepaypal_order` ON `oepaypal_order`.`oepaypal_orderid` = `oxorder`.`oxid`\n LEFT JOIN `" . $sPaymentTable . "` AS `payments` on `payments`.oxid=oxorder.oxpaymenttype ";
$sSql = str_replace('from oxorder', $sQ, $sSql);
return $sSql;
}
示例9: getContentList
/**
* Gets list of content pages which could be used for embedding
* business entity, price specification, and delivery specification data
*
* @return oxContentList
*/
public function getContentList()
{
$oContentList = oxNew("oxcontentlist");
$sTable = getViewName("oxcontents", $this->_iEditLang);
$oContentList->selectString("SELECT * FROM {$sTable} WHERE OXACTIVE = 1 AND OXTYPE = 0\n AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')\n AND OXSHOPID = '" . oxRegistry::getConfig()->getRequestParameter("oxid") . "'");
// $this->getEditObjectId()
return $oContentList;
}
示例10: loadRandomManufacturerArticles
/**
* @param $sId oxManufacturer oxId
* @param int $iAmount amount of articles to be loaded
*/
public function loadRandomManufacturerArticles($sId, $iAmount = 1)
{
//var_dump($sId);
//var_dump($iAmount);
$sArticleTable = getViewName('oxarticles');
$sSelect = "SELECT * FROM {$sArticleTable} WHERE oxmanufacturerid = '{$sId}' AND oxactive = 1 and oxissearch = 1 ORDER BY RAND() LIMIT {$iAmount}";
$this->selectString($sSelect);
}
示例11: render
/**
* 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();
$sArticleTable = getViewName('oxarticles');
//create empty edit object
$this->_aViewData["edit"] = oxNew("oxselectlist");
if (isset($sOxId) && $sOxId != "-1") {
// generating category tree for select list
// A. hack - passing language by post as lists uses only language passed by POST/GET/SESSION
$_POST["language"] = $this->_iEditLang;
$this->_createCategoryTree("artcattree", $sOxId);
// load object
$oAttr = oxNew("oxselectlist");
$oAttr->loadInLang($this->_iEditLang, $sOxId);
$aFieldList = $oAttr->getFieldList();
if (is_array($aFieldList)) {
foreach ($aFieldList as $key => $oField) {
if ($oField->priceUnit == '%') {
$oField->price = $oField->fprice;
}
}
}
$oOtherLang = $oAttr->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oAttr->loadInLang(key($oOtherLang), $sOxId);
}
$this->_aViewData["edit"] = $oAttr;
// Disable editing for derived items.
if ($oAttr->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;
}
$iErr = oxRegistry::getSession()->getVariable("iErrorCode");
if (!$iErr) {
$iErr = ERR_SUCCESS;
}
$this->_aViewData["iErrorCode"] = $iErr;
oxRegistry::getSession()->setVariable("iErrorCode", ERR_SUCCESS);
}
if (oxRegistry::getConfig()->getRequestParameter("aoc")) {
$oSelectlistMainAjax = oxNew('selectlist_main_ajax');
$this->_aViewData['oxajax'] = $oSelectlistMainAjax->getColumns();
return "popups/selectlist_main.tpl";
}
return "selectlist_main.tpl";
}
示例12: _buildSelectString
/**
* Modifying SQL query to load additional article and customer data
*
* @param object $oListObject list main object
*
* @return string
*/
protected function _buildSelectString($oListObject = null)
{
$sViewName = getViewName("oxarticles", (int) $this->getConfig()->getConfigParam("sDefaultLang"));
$sSql = "select psarticlerequest.*, {$sViewName}.oxtitle AS articletitle, ";
$sSql .= "oxuser.oxlname as userlname, oxuser.oxfname as userfname ";
$sSql .= "from psarticlerequest left join {$sViewName} on {$sViewName}.oxid = psarticlerequest.oxartid ";
$sSql .= "left join oxuser on oxuser.oxid = psarticlerequest.oxuserid WHERE 1 ";
return $sSql;
}
示例13: render
/**
* 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()
{
$myConfig = $this->getConfig();
parent::render();
$sOxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
$sArticleTable = getViewName('oxarticles');
//create empty edit object
$this->_aViewData["edit"] = oxNew("oxselectlist");
if ($sOxId != "-1" && isset($sOxId)) {
// generating category tree for select list
// A. hack - passing language by post as lists uses only language passed by POST/GET/SESSION
$_POST["language"] = $this->_iEditLang;
$sChosenArtCat = $this->_getCategoryTree("artcattree", $sChosenArtCat, $sOxId);
// load object
$oAttr = oxNew("oxselectlist");
$oAttr->loadInLang($this->_iEditLang, $sOxId);
$aFieldList = $oAttr->getFieldList();
if (is_array($aFieldList)) {
foreach ($aFieldList as $key => $oField) {
if ($oField->priceUnit == '%') {
$oField->price = $oField->fprice;
}
}
}
$oOtherLang = $oAttr->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oAttr->loadInLang(key($oOtherLang), $sOxId);
}
$this->_aViewData["edit"] = $oAttr;
// 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;
}
$iErr = oxSession::getVar("iErrorCode");
if (!$iErr) {
$iErr = ERR_SUCCESS;
}
$this->_aViewData["iErrorCode"] = $iErr;
oxSession::setVar("iErrorCode", ERR_SUCCESS);
}
if (oxConfig::getParameter("aoc")) {
$aColumns = array();
include_once 'inc/' . strtolower(__CLASS__) . '.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/selectlist_main.tpl";
}
return "selectlist_main.tpl";
}
示例14: render
/**
* Loads article variants data, passes it to Smarty engine and returns name of
* template file "article_variant.tpl".
*
* @return string
*/
public function render()
{
parent::render();
$soxId = $this->getEditObjectId();
$sSLViewName = getViewName('oxselectlist');
// all selectlists
$oAllSel = oxNew("oxlist");
$oAllSel->init("oxselectlist");
$sQ = "select * from {$sSLViewName}";
$oAllSel->selectString($sQ);
$this->_aViewData["allsel"] = $oAllSel;
$oArticle = oxNew("oxArticle");
$this->_aViewData["edit"] = $oArticle;
if (isset($soxId) && $soxId != "-1") {
// load object
$oArticle->loadInLang($this->_iEditLang, $soxId);
if ($oArticle->isDerived()) {
$this->_aViewData['readonly'] = true;
}
$_POST["language"] = $_GET["language"] = $this->_iEditLang;
$oVariants = $oArticle->getAdminVariants($this->_iEditLang);
$this->_aViewData["mylist"] = $oVariants;
// load object in other languages
$oOtherLang = $oArticle->getAvailableInLangs();
if (!isset($oOtherLang[$this->_iEditLang])) {
// echo "language entry doesn't exist! using: ".key($oOtherLang);
$oArticle->loadInLang(key($oOtherLang), $soxId);
}
foreach ($oOtherLang as $id => $language) {
$oLang = new stdClass();
$oLang->sLangDesc = $language;
$oLang->selected = $id == $this->_iEditLang;
$this->_aViewData["otherlang"][$id] = clone $oLang;
}
if ($oArticle->oxarticles__oxparentid->value) {
$this->_aViewData["parentarticle"] = $this->_getProductParent($oArticle->oxarticles__oxparentid->value);
$this->_aViewData["oxparentid"] = $oArticle->oxarticles__oxparentid->value;
$this->_aViewData["issubvariant"] = 1;
// A. disable variant information editing for variant
$this->_aViewData["readonly"] = 1;
}
$this->_aViewData["editlanguage"] = $this->_iEditLang;
$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] = $oLang;
}
}
return "article_variant.tpl";
}
示例15: testGetQuerySynchoxid
/**
* DiscountMainAjax::_getQuery() test case
*
* @return null
*/
public function testGetQuerySynchoxid()
{
$sSynchoxid = '_testSynchoxid';
$this->setRequestParameter("synchoxid", $sSynchoxid);
$sTable = getViewName("oxcountry");
$oView = oxNew('discount_main_ajax');
$sQuery = "from {$sTable} where {$sTable}.oxactive = '1' and";
$sQuery .= " {$sTable}.oxid not in ( select {$sTable}.oxid from oxobject2discount, {$sTable} where {$sTable}.oxid=oxobject2discount.oxobjectid";
$sQuery .= " and oxobject2discount.oxdiscountid = '_testSynchoxid' and oxobject2discount.oxtype = 'oxcountry' )";
$this->assertEquals($sQuery, trim($oView->UNITgetQuery()));
}