本文整理汇总了PHP中get_templates_array函数的典型用法代码示例。如果您正苦于以下问题:PHP get_templates_array函数的具体用法?PHP get_templates_array怎么用?PHP get_templates_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_templates_array函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serviceGetTemplates
public function serviceGetTemplates($bEnabledOnly = true, $bShortInfo = true)
{
$aValues = get_templates_array($bEnabledOnly, $bShortInfo);
$aResult = array();
foreach ($aValues as $sKey => $sValue) {
$aResult[] = array('key' => $sKey, 'value' => $sValue);
}
return $aResult;
}
示例2: getListTemplate
function getListTemplate($sCurrent)
{
$sOutputCode = "";
$aTemplates = get_templates_array();
if (count($aTemplates) < 2) {
return $sOutputCode;
}
$sGetTransfer = bx_encode_url_params($_GET, array('skin'));
$aTmplVars = array();
foreach ($aTemplates as $sName => $sTitle) {
$aTmplVars[] = array('bx_if:show_icon' => array('condition' => false, 'content' => array()), 'class' => $sName == $sCurrent ? 'sys-bm-sub-item-selected' : '', 'link' => bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin=' . $sName, 'onclick' => '', 'title' => $sTitle);
}
$sOutputCode .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_bottom_menu_sub_items.html', array('name_method' => 'Template', 'name_block' => 'template', 'bx_repeat:items' => $aTmplVars));
return PopupBox('sys-bm-switcher-template', _t('_sys_bm_popup_cpt_design'), $sOutputCode);
}
示例3: loadData
protected function loadData()
{
$this->setSelected('', $this->_oTemplate->getCode());
$aPage = explode('?', $_SERVER['HTTP_REFERER']);
$aPageParams = array();
if (!empty($aPage[1])) {
parse_str($aPage[1], $aPageParams);
}
$aTemplates = get_templates_array(true, true);
$aItems = array();
foreach ($aTemplates as $sName => $sTemplate) {
$aPageParams['skin'] = $sName;
$aItems[] = array('id' => $sName, 'name' => $sName, 'class' => '', 'title' => $sTemplate, 'target' => '_self', 'icon' => '', 'link' => bx_html_attribute(bx_append_url_params($aPage[0], $aPageParams)), 'onclick' => '');
}
$this->_aObject['menu_items'] = $aItems;
}
示例4: PageCodeTemplates
function PageCodeTemplates($sResult)
{
$a = get_templates_array(true);
$aTemplates = array();
foreach ($a as $k => $r) {
$aTemplates[] = array('key' => $k, 'name' => htmlspecialchars_adv($r['name']), 'ver' => htmlspecialchars_adv($r['ver']), 'vendor' => htmlspecialchars_adv($r['vendor']), 'desc' => $r['desc'], 'bx_if:preview' => array('condition' => (bool) $r['preview'], 'content' => array('img' => $r['preview'])), 'bx_if:no_preview' => array('condition' => !$r['preview'], 'content' => array()), 'bx_if:default' => array('condition' => $k == getParam('template'), 'content' => array()), 'bx_if:make_default' => array('condition' => $k != getParam('template'), 'content' => array('key' => $k)), 'bx_if:delete' => array('condition' => $k != getParam('template') && $k != 'uni' && $k != 'alt', 'content' => array('key' => $k)));
}
$s = $sResult ? MsgBox($sResult, 10) : '';
$s .= $GLOBALS['oAdmTemplate']->parseHtmlByName('templates.html', array('bx_repeat:templates' => $aTemplates));
$sCode = DesignBoxAdmin($GLOBALS['sPageTitle'], $s, $GLOBALS['aTopItems'], '', 11);
if ('on' == getParam('feeds_enable')) {
$sCode = $sCode . DesignBoxAdmin(_t('_adm_box_cpt_design_templates'), '<div class="RSSAggrCont" rssid="boonex_unity_market_templates" rssnum="5" member="0">' . $GLOBALS['oFunctions']->loadingBoxInline() . '</div>');
}
$GLOBALS['oAdmTemplate']->addJsTranslation(array('_Are_you_sure'));
return $sCode;
}
示例5: getSwitcherTemplate
function getSwitcherTemplate()
{
$sContent = '';
if (getParam('enable_template') != 'on') {
return $sContent;
}
$iTmplsCount = count(get_templates_array());
if ($iTmplsCount <= 1) {
return $sContent;
}
$sTemplName = $GLOBALS['oSysTemplate']->getCode();
$aTmplVars = array();
$aTmplVars[] = array('caption' => _t('_sys_bm_design', $sTemplName), 'link' => 'javascript:void(0)', 'script' => 'onclick="javascript:showPopupTemplate()"', 'target' => '');
$sContent .= $GLOBALS['oSysTemplate']->parseHtmlByName('extra_' . $this->sName . '_menu.html', array('bx_repeat:items' => $aTmplVars));
$sContent .= $GLOBALS['oFunctions']->getTemplateSwitcher($sTemplName);
return $sContent;
}
示例6: getGeneral
protected function getGeneral()
{
$sJsObject = $this->getPageJsObject();
$oTemplate = BxDolStudioTemplate::getInstance();
$sResult = '';
$sTemplate = getParam('template');
$aTemplates = get_templates_array(true, false);
$aTmplVarsTemplates = array();
foreach ($aTemplates as $sUri => $aTemplate) {
$sIcon = $this->getModuleIcon($aTemplate, 'store');
$bIcon = strpos($sIcon, '.') === false;
$aTmplVarsTemplates[] = array('uri' => $sUri, 'title' => htmlspecialchars_adv($aTemplate['title']), 'version' => htmlspecialchars_adv($aTemplate['version']), 'vendor' => htmlspecialchars_adv($aTemplate['vendor']), 'bx_if:icon' => array('condition' => $bIcon, 'content' => array('icon' => $sIcon)), 'bx_if:image' => array('condition' => !$bIcon, 'content' => array('icon_url' => $sIcon)), 'bx_if:default' => array('condition' => $sUri == $sTemplate, 'content' => array()), 'bx_if:make_default' => array('condition' => $sUri != $sTemplate, 'content' => array('js_object' => $sJsObject, 'uri' => $sUri)));
}
$sContent = $sResult ? MsgBox($sResult, 10) : '';
$sContent .= $oTemplate->parseHtmlByName('templates.html', array('bx_repeat:templates' => $aTmplVarsTemplates));
return $oTemplate->parseHtmlByName('designer.html', array('js_object' => $this->getPageJsObject(), 'content' => $sContent));
}
示例7: _isVisible
protected function _isVisible($a)
{
if (!parent::_isVisible($a)) {
return false;
}
$bResult = true;
switch ($a['name']) {
case 'switch_language':
$aLanguages = BxDolLanguagesQuery::getInstance()->getLanguages(false, true);
if (count($aLanguages) <= 1) {
$bResult = false;
}
break;
case 'switch_template':
$aTemplates = get_templates_array(true, true);
if (count($aTemplates) <= 1) {
$bResult = false;
}
break;
}
return $bResult;
}
示例8: templates_select_txt
function templates_select_txt()
{
$templ_choices = get_templates_array();
$current_template = strlen($_GET['skin']) ? $_GET['skin'] : $_COOKIE['skin'];
foreach ($templ_choices as $tmpl_key => $tmpl_value) {
if ($current_template == $tmpl_key) {
$ReturnResult .= $tmpl_value . ' | ';
} else {
$sGetTransfer = bx_encode_url_params($_GET, array('skin'));
$ReturnResult .= '<a href="' . bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin=' . $tmpl_key . '">' . $tmpl_value . '</a> | ';
}
}
return $ReturnResult;
}
示例9: templates_select_txt
function templates_select_txt()
{
global $dir;
$templ_choices = get_templates_array();
$current_template = strlen($_GET['skin']) ? $_GET['skin'] : $_COOKIE['skin'];
foreach ($templ_choices as $tmpl_key => $tmpl_value) {
if ($current_template == $tmpl_key) {
$ReturnResult .= $tmpl_value;
$ReturnResult .= ' | ';
} else {
foreach ($_GET as $param_key => $param_value) {
if ('skin' != $param_key) {
$sGetTransfer .= "&{$param_key}={$param_value}";
}
}
$ReturnResult .= '<a href="' . $_SERVER['PHP_SELF'] . '?skin=' . $tmpl_key . $sGetTransfer . '">' . $tmpl_value . '</a>';
$ReturnResult .= ' | ';
}
}
return $ReturnResult;
}
示例10: display_category_settings
//.........这里部分代码省略.........
$class = 'table_odd';
}
}
$i++;
echo "<tr class=\"{$class}\"><td align=\"left\" class=\"small1\"";
// Display item caption.
if ('text' == $param_type) {
echo ' valign="top"';
}
echo ">{$param_desc}</td><td align=\"right\" width=\"200\">";
// Display item control.
if ('text' == $param_type) {
if (EMAIL_TEMPLATE_CATEGORY == $cat) {
// Get email subject.
$subject_name = $param_name . '_subject';
$q_str = "SELECT `VALUE` FROM `GlParams` WHERE `Name` = '{$subject_name}'";
$res = db_res($q_str);
if ($row = mysql_fetch_array($res)) {
$subject_value = $row['VALUE'];
} else {
$subject_value = '';
}
echo "<b>HTML version</b> (";
echo "<a href=\"javascript:void(0);\" onClick=\"javascript:docOpen('" . rawurlencode($param_value) . "');\">";
echo _t("_Preview");
echo "</a>)<br>";
echo 'Subject:<br />';
echo "<input type=\"text\" class=\"no\" size=\"50\" name=\"{$param_name}_subject\" value=\"{$subject_value}\"/><br /><br />";
echo 'Body:<br />';
echo "<textarea cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}\">" . htmlspecialchars($param_value) . "</textarea>";
$tags = '<RealName> <SiteName> <ConfCode> <ConfirmationLink> <StrID> <Email> <Password> <YourRealName> <NickName>
<Domain> <ID> <TEXT> <VKissLink> <ContactInfo> <DomainName> <FromName> <Link> <NickSpamer> <IDspamer>
<LinkSpamer> <MatchProfileLink> <Requester> <Profile> <site> <PrivPhotosMember> <LoginLink> <Title>
<Message_Text> <MessageText> <LinkSDatingEvent> <NameSDating> <PlaceSDating> <WhenStarSDating> <PersonalUID>
<MatchLink>';
echo '<br><br><br><b>Text version</b><br>';
echo 'Subject:<br />';
echo "<input readonly type=\"text\" class=\"no\" size=\"50\" name=\"{$param_name}_subject_ro\" value=\"{$subject_value}\"/><br /><br />";
echo 'Body:<br />';
echo "<textarea readonly cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}_ro\">" . htmlspecialchars(html2txt($param_value, $tags)) . "</textarea>";
} else {
echo "<textarea cols=\"50\" rows=\"10\" class=\"no\" name=\"{$param_name}\">{$param_value}</textarea>";
}
} elseif ('digit' == $param_type) {
echo "<input type=\"text\" class=\"no\" name=\"{$param_name}\" size=\"15\" value=\"{$param_value}\" />";
} elseif ('checkbox' == $param_type) {
echo "<input type=\"checkbox\" name=\"{$param_name}\" " . ('on' == $param_value ? 'checked' : '') . '>';
} elseif ('select' == $param_type) {
if ('chicks_for_free' == $param_name) {
$vals = getParam('chicks_for_free', false);
$query = "SELECT `extra` FROM `ProfilesDesc` WHERE name='Sex'";
$result = db_arr($query);
$result['extra'] = str_replace('\'', '', $result['extra']);
$sex = split(',', $result['extra']);
echo "<select name=\"{$param_name}[]\" multiple>";
foreach ($sex as $sex_key) {
if (strstr($vals, '\'' . $sex_key . '\'')) {
$selected = 'selected';
} else {
$selected = '';
}
echo "<option value=\"{$sex_key}\" {$selected} >{$sex_key}</option>";
}
echo "</select>";
} else {
echo " ";
}
} elseif ('combobox' == $param_type) {
if ('chicks_for_free_membership' == $param_name) {
$memberships_arr = getMemberships();
$vals = getParam('chicks_for_free_membership', false);
echo "<select name=\"{$param_name}\">";
foreach ($memberships_arr as $membershipID => $membershipName) {
if ($membershipID == MEMBERSHIP_ID_NON_MEMBER) {
continue;
}
$selected = (int) $vals == $membershipID ? ' selected ' : '';
echo "<option value=\"{$membershipID}\" {$selected} >{$membershipName}</option>";
}
echo "</select>";
} elseif ('template' == $param_name) {
$old_val = getParam('template');
$templ_choices = get_templates_array();
echo "<select name=\"{$param_name}\">";
foreach ($templ_choices as $key => $value) {
echo "<option value=\"{$key}\" " . ($old_val == $key ? 'selected="selected"' : '') . ">{$value}</option>\n";
}
echo "</select>";
}
} else {
echo "<input type=\"text\" name=\"{$param_name}\" value=\"{$param_value}\" size=\"30\" />";
}
echo "</td></tr>";
}
?>
</table>
</center><br />
<?php
return ' ';
}
示例11: genMoreTemplatesElement
function genMoreTemplatesElement()
{
if (!getParam("enable_template")) {
return;
}
$aExistedTemplates = get_templates_array();
if (count($aExistedTemplates) <= 1) {
return;
}
$sCurTemplate = strlen($_GET['skin']) ? $_GET['skin'] : $_COOKIE['skin'];
$sTemplateElement = '';
foreach ($aExistedTemplates as $sTemplateID => $sTemplateVal) {
$sIActiveClass = $sCurTemplate == $sTemplateID ? ' active' : '';
$sTemplateUrl = '';
if ($sCurTemplate == $sTemplateID) {
$sTemplateUrl = 'javascript: void(0)';
} else {
if (defined('BX_PROFILE_PAGE')) {
global $profileID;
$sTemplateUrl = getProfileLink($profileID) . '&skin=' . $sTemplateID;
} else {
$sGetTransfer = bx_encode_url_params($_GET, array('skin'));
$sTemplateUrl = bx_html_attribute($_SERVER['PHP_SELF']) . '?' . $sGetTransfer . 'skin=' . $sTemplateID;
}
}
//$sIOnclick = "window.open('{$sTemplateUrl}','_self');"; // old version
$sTemplateElement .= '<li><a href="' . $sTemplateUrl . '" class="button more_ntop_element' . $sIActiveClass . '">' . $sTemplateVal . '</a>';
}
if ($sTemplateElement == '') {
return;
}
return array('icon_url' => getTemplateIcon('tm_item_templates.png'), 'element_content' => $sTemplateElement);
}