本文整理汇总了PHP中Sugar_Smarty::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP Sugar_Smarty::fetch方法的具体用法?PHP Sugar_Smarty::fetch怎么用?PHP Sugar_Smarty::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sugar_Smarty
的用法示例。
在下文中一共展示了Sugar_Smarty::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdditionsHtml
function getAdditionsHtml($focus, $name, $value, $view)
{
if ('EditView' != $view && 'DetailView' != $view) {
return "";
// skip the rest of the method if another view calls this method
}
global $mod_strings;
global $app_list_strings;
//2.2RC2 translation eroor fix
$status_list = $app_list_strings["oqc_addition_status_dom"];
$additions = $focus->getAdditions();
foreach ($additions as &$addition) {
$addition = $addition->toArray();
if (isset($status_list[$addition['status']])) {
$addition['status'] = $status_list[$addition['status']];
}
}
global $sugar_version;
$smarty = new Sugar_Smarty();
$smarty->assign('additions', $additions);
$smarty->assign($mod_strings);
if (substr($sugar_version, 0, 1) == '6') {
return $smarty->fetch('include/oqc/Additions/' . $view . '.html');
} else {
return $smarty->fetch('include/oqc/Additions/' . $view . '52.html');
}
}
示例2: getImageHtml
function getImageHtml($focus, $name, $value, $view)
{
if ('EditView' != $view && 'DetailView' != $view) {
return "";
// skip the rest of the method if another view calls this method
}
global $app_list_strings;
$languageStrings = $app_list_strings["oqc"]["Services"];
require_once 'include/Sugar_Smarty.php';
//1.7.6 Workaround for image display without modifying htaccess file
require_once 'include/oqc/common/Configuration.php';
if (isset($focus->image_unique_filename)) {
global $sugar_config;
$conf = Configuration::getInstance();
$oqc_uploadDir = $conf->get('fileUploadDir');
$uploadDir = $oqc_uploadDir ? $oqc_uploadDir : $sugar_config['upload_dir'];
if (file_exists($uploadDir . "th" . $focus->image_unique_filename)) {
$imageurl = "oqc/GetImage.php?module=oqc_Product&id=th" . $focus->image_unique_filename;
} else {
$imageurl = "oqc/GetImage.php?module=oqc_Product&id=" . $focus->image_unique_filename;
}
} else {
$imageurl = '';
}
$smarty = new Sugar_Smarty();
$smarty->assign('image_url', $imageurl);
$smarty->assign('languageStrings', $languageStrings);
return $smarty->fetch('include/oqc/Products/Image.' . $view . '.html');
}
示例3: display
/**
* @see SugarView::display()
*/
public function display()
{
$ss = new Sugar_Smarty();
$ss->assign("MOD", $GLOBALS['mod_strings']);
$ss->assign("MESSAGE", $GLOBALS['message']);
echo $ss->fetch("modules/xeBaySellerLists/tpls/importfinal.tpl");
}
示例4: template_groups_chooser
function template_groups_chooser(&$args)
{
global $mod_strings, $js_loaded;
$table_style = '';
if (!empty($args['display'])) {
$table_style = "display: " . $args['display'] . "\"";
}
$uparraow_big = SugarThemeRegistry::current()->getImage('uparrow_big', 'border="0" style="margin-bottom: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
$downarrow_big = SugarThemeRegistry::current()->getImage('downarrow_big', 'border="0" style="margin-top: 1px;" ', null, null, '.gif', $mod_strings['LBL_SORT']);
$leftarrow_big = SugarThemeRegistry::current()->getImage('leftarrow_big', 'border="0" style="margin-right: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
$rightarrow_big = SugarThemeRegistry::current()->getImage('rightarrow_big', 'border="0" style="margin-left: 1px;"', null, null, '.gif', $mod_strings['LBL_SORT']);
$smarty = new Sugar_Smarty();
$smarty->assign('args', $args);
$smarty->assign('js_loaded', $js_loaded);
$smarty->assign('table_style', $table_style);
$smarty->assign('uparraow_big', $uparraow_big);
$smarty->assign('downarrow_big', $downarrow_big);
$smarty->assign('leftarrow_big', $leftarrow_big);
$smarty->assign('rightarrow_big', $rightarrow_big);
$smarty->assign('table_style', $table_style);
//echo $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl");
if ($js_loaded == false) {
$js_loaded = true;
}
return $smarty->fetch("modules/Reports/templates/_template_groups_chooser.tpl");
}
示例5: display
function display()
{
$ss = new Sugar_Smarty();
$ss->assign('lbl_campaign_name', translate('LBL_TOP_CAMPAIGNS_NAME', 'Campaigns'));
$ss->assign('lbl_revenue', translate('LBL_TOP_CAMPAIGNS_REVENUE', 'Campaigns'));
$ss->assign('top_campaigns', $this->top_campaigns);
return parent::display() . $ss->fetch('modules/Campaigns/Dashlets/TopCampaignsDashlet/TopCampaignsDashlet.tpl');
}
示例6: display
function display()
{
global $mod_strings;
$smarty = new Sugar_Smarty();
$mb = new ModuleBuilder();
//if (!empty($_REQUEST['package'])) {
if (empty($_REQUEST['package']) && empty($_REQUEST['new'])) {
$this->generatePackageButtons($mb->getPackageList());
$smarty->assign('buttons', $this->buttons);
$smarty->assign('title', $GLOBALS['mod_strings']['LBL_MODULEBUILDER']);
$smarty->assign("question", $GLOBALS['mod_strings']['LBL_QUESTION_PACKAGE']);
$smarty->assign("defaultHelp", "mbHelp");
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], '');
$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
echo $ajax->getJavascript();
} else {
$name = !empty($_REQUEST['package']) ? $_REQUEST['package'] : '';
$mb->getPackage($name);
require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
$mbt = new MBPackageTree();
$nodes = $mbt->fetchNodes();
$package_labels = array();
if (!empty($nodes['tree_data']['nodes'])) {
foreach ($nodes['tree_data']['nodes'] as $entry) {
if (!empty($entry['data']['label']) && $name != $entry['data']['label']) {
$package_labels[] = strtoupper($entry['data']['label']);
}
}
}
$json = getJSONobj();
$smarty->assign('package_labels', $json->encode($package_labels));
$this->package =& $mb->packages[$name];
$this->loadModuleTypes();
$this->loadPackageHelp($name);
$this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified);
$smarty->assign('package', $this->package);
$smarty->assign('mod_strings', $mod_strings);
$smarty->assign('package_already_deployed', 'false');
foreach ($this->package->modules as $a_module) {
if (in_array($a_module->key_name, $GLOBALS['moduleList'])) {
$smarty->assign('package_already_deployed', 'true');
break;
}
}
$ajax = new AjaxCompose();
$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
if (empty($name)) {
$name = $mod_strings['LBL_NEW_PACKAGE'];
}
$ajax->addCrumb($name, '');
$html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') {
$html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
}
$ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
echo $ajax->getJavascript();
}
}
示例7: display
public function display()
{
if (!SugarOAuthServer::enabled()) {
sugar_die($GLOBALS['mod_strings']['LBL_OAUTH_DISABLED']);
}
global $current_user;
if (!isset($_REQUEST['token']) && isset($_REQUEST['oauth_token'])) {
$_REQUEST['token'] = $_REQUEST['oauth_token'];
}
$sugar_smarty = new Sugar_Smarty();
$sugar_smarty->assign('APP', $GLOBALS['app_strings']);
$sugar_smarty->assign('MOD', $GLOBALS['mod_strings']);
$sugar_smarty->assign('token', $_REQUEST['token']);
$sugar_smarty->assign('sid', session_id());
$token = OAuthToken::load($_REQUEST['token']);
if (empty($token) || empty($token->consumer) || $token->tstate != OAuthToken::REQUEST || empty($token->consumer_obj)) {
sugar_die('Invalid token');
}
if (empty($_REQUEST['confirm'])) {
$sugar_smarty->assign('consumer', sprintf($GLOBALS['mod_strings']['LBL_OAUTH_CONSUMERREQ'], $token->consumer_obj->name));
// SM: roles disabled for now
// $roles = array('' => '');
// $allroles = ACLRole::getAllRoles();
// foreach($allroles as $role) {
// $roles[$role->id] = $role->name;
// }
// $sugar_smarty->assign('roles', $roles);
$hash = md5(rand());
$_SESSION['oauth_hash'] = $hash;
$sugar_smarty->assign('hash', $hash);
echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorize.tpl');
} else {
if ($_REQUEST['sid'] != session_id() || $_SESSION['oauth_hash'] != $_REQUEST['hash']) {
sugar_die('Invalid request');
}
$verify = $token->authorize(array("user" => $current_user->id));
if (!empty($token->callback_url)) {
$redirect_url = $token->callback_url;
if (strchr($redirect_url, "?") !== false) {
$redirect_url .= '&';
} else {
$redirect_url .= '?';
}
$redirect_url .= "oauth_verifier=" . $verify . '&oauth_token=' . $_REQUEST['token'];
SugarApplication::redirect($redirect_url);
}
$sugar_smarty->assign('VERIFY', $verify);
$sugar_smarty->assign('token', '');
echo $sugar_smarty->fetch('modules/OAuthTokens/tpl/authorized.tpl');
}
}
示例8: display
function display()
{
//turn off all error reporting so that PHP warnings don't munge the PDF code
error_reporting(E_ALL);
set_time_limit(1800);
//Create new page
$this->AddPage();
$this->SetFont(PDF_FONT_NAME_MAIN, '', 8);
if (!empty($this->templateLocation)) {
$str = $this->ss->fetch($this->templateLocation);
$this->writeHTML($str, $this->smartyLn, $this->smartyFill, $this->smartyReseth, $this->smartyCell, $this->smartyAlign);
} else {
$this->Error('The class SugarpdfSmarty has to be extended and you have to set a location for the Smarty template.');
}
}
示例9: snippet
function snippet()
{
/* get sort order from session */
//session_start(); // Make a reference to the current session object,set order
//$_SESSION['regnamesort']= 'test' ; Set a value in a session variable
//$GLOBALS['log']->fatal('start display');
//var_dump($this->bean);
$smarty = new Sugar_Smarty();
//parent::display();
$db = DBManagerFactory::getInstance();
$myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname, tab5a.mrn_c mrn, tab4a.gender gender FROM reg_patient tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'";
$result = $db->query($myquery);
$patdata = null;
$row = $db->fetchRow($result);
$smarty->assign("patdata", $row);
$risk = new RiskEvaluation();
//when week filter need to add week interval
//get patient risk if exists
//if ($_POST['mysort'] == 'week')
if (!empty($_REQUEST['patid'])) {
$risk->getRisk($_REQUEST['patid']);
$smarty->assign("pid", $_REQUEST['patid']);
}
//echo 'request'.$_REQUEST['patid'];
//else return false; //param not found
//var_dump($risk);
$smarty->assign("myrisk", $risk);
global $current_user;
$smarty->assign("myuser", $current_user);
$smarty->assign("test", "test");
return $smarty->fetch('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl');
}
示例10: display
/**
* @see SugarView::display()
*/
public function display()
{
$ss = new Sugar_Smarty();
$ss->assign("MOD", $GLOBALS['mod_strings']);
$ss->assign("INSTRUCTION", "<h1>Retrieve seller list from ebay</h1>");
$bean = BeanFactory::getBean('xeBayAccounts');
$resp = $bean->get_list("", "ebay_auth_token<>''", 0, -1, -1, 0, false, array('name'));
if ($resp['row_count'] > 0) {
$ebay_account_options = "<select name='ebay_account_name' id='ebay_account_name' title=''>";
if ($resp['row_count'] > 1) {
$ebay_account_options .= "<option value='All'>All</option>";
}
foreach ($resp['list'] as &$account) {
$name = $account->name;
$ebay_account_options .= "<option value='{$name}'>{$name}</option>";
}
$ebay_account_options .= "</select>";
$ss->assign("EBAY_ACCOUNT_OPTIONS", $ebay_account_options);
}
$javascript = <<<EOQ
function ImportConfirm()
{
\t\treturn confirm("Do you want to retrieve seller list now ?");
}
EOQ;
$ss->assign("JAVASCRIPT", $javascript);
echo $ss->fetch("modules/xeBaySellerLists/tpls/import.tpl");
}
示例11: display
function display()
{
global $current_user, $mod_strings;
$smarty = new Sugar_Smarty();
$mb = new MBPackage("packageCustom");
$mod = $mb->getCustomModules();
$modules = array();
$custom = array();
if (is_array($mod)) {
foreach ($mod as $key => $value) {
$modules[] = $key;
$custom[] = $value;
}
}
$nb_mod = count($modules);
$smarty->assign('mod_strings', $mod_strings);
$smarty->assign('modules', $mod);
$smarty->assign('custom', $custom);
$smarty->assign('nb_mod', $nb_mod);
$smarty->assign('defaultHelp', 'exportHelp');
$smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']);
$smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']);
$ajax = new AjaxCompose();
$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
$ajax->addSection('center', $mod_strings['LBL_EC_TITLE'], $smarty->fetch($this->getCustomFilePathIfExists('modules/ModuleBuilder/tpls/exportcustomizations.tpl')));
echo $ajax->getJavascript();
}
示例12: display
/**
* @see SugarView::display()
*/
public function display()
{
$offset = -1;
$modules = array();
if (!empty($_REQUEST['zoom'])) {
$modules = array($_REQUEST['zoom']);
if (isset($_REQUEST['offset'])) {
$offset = $_REQUEST['offset'];
}
}
$limit = !empty($GLOBALS['sugar_config']['max_spotresults_initial']) ? $GLOBALS['sugar_config']['max_spotresults_initial'] : 5;
if ($offset !== -1) {
$limit = !empty($GLOBALS['sugar_config']['max_spotresults_more']) ? $GLOBALS['sugar_config']['max_spotresults_more'] : 20;
}
$options = array('current_module' => $this->module, 'modules' => $modules);
$searchEngine = SugarSearchEngineFactory::getInstance('', array(), true);
$trimmed_query = trim($_REQUEST['q']);
$rs = $searchEngine->search($trimmed_query, $offset, $limit, $options);
$formattedResults = $this->formatSearchResultsToDisplay($rs, $offset, $trimmed_query);
$query_encoded = urlencode($trimmed_query);
$displayMoreForModule = $formattedResults['displayMoreForModule'];
$displayResults = $formattedResults['displayResults'];
$ss = new Sugar_Smarty();
$ss->assign('displayResults', $displayResults);
$ss->assign('displayMoreForModule', $displayMoreForModule);
$ss->assign('appStrings', $GLOBALS['app_strings']);
$ss->assign('appListStrings', $GLOBALS['app_list_strings']);
$ss->assign('queryEncoded', $query_encoded);
$ss->assign('test', "#bwc/index.php?module=Home&action=UnifiedSearch&search_form=false&advanced=false&query_string=" . $query_encoded);
echo $ss->fetch(SugarAutoLoader::existingCustomOne('include/SearchForm/tpls/SugarSpot.tpl'));
}
示例13: display
function display()
{
$smarty = new Sugar_Smarty();
$smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']);
$smarty->assign('mod', $GLOBALS['mod_strings']);
if (isset($_REQUEST['label'])) {
$smarty->assign('label', $_REQUEST['label']);
}
$options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://';
$smarty->assign('options', $options);
$ajax = new AjaxCompose();
$ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")');
$ajax->addCrumb(translate('LBL_SYNCPORTAL', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=portalsync")');
$ajax->addSection('center', translate('LBL_SYNCPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalsync.tpl'));
$GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalsync.tpl'));
echo $ajax->getJavascript();
}
示例14: display
function display()
{
$ss = new Sugar_Smarty();
$ss->assign('lblTotalOpportunities', translate('LBL_TOTAL_OPPORTUNITIES', 'Opportunities'));
$ss->assign('lblClosedWonOpportunities', translate('LBL_CLOSED_WON_OPPORTUNITIES', 'Opportunities'));
$ss->assign('total_opportunities', $this->total_opportunities);
$ss->assign('total_opportunities_won', $this->total_opportunities_won);
return parent::display() . $ss->fetch('modules/Opportunities/Dashlets/MyClosedOpportunitiesDashlet/MyClosedOpportunitiesDashlet.tpl');
}
示例15: display
/**
* This function loads portal config vars from db and sets them for the view
* @see SugarView::display() for more info
*/
function display()
{
$portalFields = array('appStatus' => 'offline', 'logoURL' => '', 'maxQueryResult' => '20', 'maxSearchQueryResult' => '5', 'defaultUser' => '');
$userList = get_user_array();
$userList[''] = '';
require_once "modules/MySettings/TabController.php";
$controller = new TabController();
$disabledModulesFlag = false;
$disabledModules = array_diff($controller->getAllPortalTabs(), $controller->getPortalTabs());
if (!empty($disabledModules)) {
$disabledModulesFlag = true;
array_walk($disabledModules, function (&$item) {
$item = translate($item);
});
}
$admin = Administration::getSettings();
$portalConfig = $admin->getConfigForModule('portal', 'support', true);
$portalConfig['appStatus'] = !empty($portalConfig['on']) ? 'online' : 'offline';
$smarty = new Sugar_Smarty();
$smarty->assign('disabledDisplayModulesList', $disabledModules);
$smarty->assign('disabledDisplayModules', $disabledModulesFlag);
foreach ($portalFields as $fieldName => $fieldDefault) {
if (isset($portalConfig[$fieldName])) {
$smarty->assign($fieldName, html_entity_decode($portalConfig[$fieldName]));
} else {
$smarty->assign($fieldName, $fieldDefault);
}
}
$smarty->assign('userList', $userList);
$smarty->assign('welcome', $GLOBALS['mod_strings']['LBL_SYNCP_WELCOME']);
$smarty->assign('mod', $GLOBALS['mod_strings']);
$smarty->assign('siteURL', $GLOBALS['sugar_config']['site_url']);
if (isset($_REQUEST['label'])) {
$smarty->assign('label', $_REQUEST['label']);
}
$options = !empty($GLOBALS['system_config']->settings['system_portal_url']) ? $GLOBALS['system_config']->settings['system_portal_url'] : 'https://';
$smarty->assign('options', $options);
$ajax = new AjaxCompose();
$ajax->addCrumb(translate('LBL_SUGARPORTAL', 'ModuleBuilder'), 'ModuleBuilder.main("sugarportal")');
$ajax->addCrumb(ucwords(translate('LBL_PORTAL_CONFIGURE')), '');
$ajax->addSection('center', translate('LBL_SUGARPORTAL', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
$GLOBALS['log']->debug($smarty->fetch('modules/ModuleBuilder/tpls/portalconfig.tpl'));
echo $ajax->getJavascript();
}