当前位置: 首页>>代码示例>>PHP>>正文


PHP Sugar_Smarty类代码示例

本文整理汇总了PHP中Sugar_Smarty的典型用法代码示例。如果您正苦于以下问题:PHP Sugar_Smarty类的具体用法?PHP Sugar_Smarty怎么用?PHP Sugar_Smarty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Sugar_Smarty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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");
 }
开发者ID:sunmo,项目名称:snowlotus,代码行数:10,代码来源:view.importfinal.php

示例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');
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:29,代码来源:Image.php

示例3: 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");
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:templates_group_chooser.php

示例4: display

 function display()
 {
     $db = DBManagerFactory::getInstance();
     /* <<<<<<< HEAD
     		$sql = "SELECT p.id,p.first_name,p.last_name,p.dob FROM reg_patient p WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.next_pmp_review_due_c is not null) ORDER By p.last_name, p.first_name";
     ======= */
     $sql = "SELECT p.id,p.first_name,p.last_name,p.dob, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) ORDER By p.last_name, p.first_name";
     // >>>>>>> 3097a71433de82fec730df252659026274347e46
     $resultb = $db->query($sql, true);
     $final = array();
     while ($row = $db->fetchByAssoc($resultb)) {
         $final[] = $row;
     }
     $sql1 = "SELECT p.id, rec.mrn_c AS mrn,(SELECT p1b.name provname FROM reg_provider p1b,reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = p.id AND p2b.deleted =0)provname FROM reg_patient p LEFT JOIN reg_patient_cstm rec ON rec.id_c = p.id WHERE p.id not in (SELECT distinct pe.reg_patient_reg_encounterreg_patient_ida FROM `reg_patient_reg_encounter_c` pe, reg_encounter_cstm e WHERE pe.reg_patient_reg_encounterreg_encounter_idb=e.id_c AND e.last_pmp_review_done_c is not null) GROUP BY provname ORDER By p.last_name, p.first_name";
     $resultb1 = $db->query($sql1, true);
     $final1 = array();
     while ($row1 = $db->fetchByAssoc($resultb1)) {
         $final1[] = $row1;
     }
     $sugarSmarty = new Sugar_Smarty();
     $sugarSmarty->assign("data", $final);
     $sugarSmarty->assign("data1", $final1);
     $sugarSmarty->assign("title", "Patients who do not have PMP");
     $sugarSmarty->display('custom/modules/REG_Patient/tpls/Report1REG_Patient.tpl');
     //        parent::display();
 }
开发者ID:apikck,项目名称:REG_Patient,代码行数:26,代码来源:view.reports1.php

示例5: display

 /**
  * @see ViewQuickcreate::display()
  */
 public function display()
 {
     $userPref = $GLOBALS['current_user']->getPreference('email_link_type');
     $defaultPref = $GLOBALS['sugar_config']['email_default_client'];
     if ($userPref != '') {
         $client = $userPref;
     } else {
         $client = $defaultPref;
     }
     if ($client == 'sugar') {
         $eUi = new EmailUI();
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan'))) {
             $fullComposeUrl = "index.php?module=Emails&action=Compose&parent_id={$this->bean->id}&parent_type={$this->bean->module_dir}";
             $composeData = array('parent_id' => $this->bean->id, 'parent_type' => $this->bean->module_dir);
         } else {
             $fullComposeUrl = "index.php?module=Emails&action=Compose";
             $composeData = array('parent_id' => '', 'parent_type' => '');
         }
         $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, $fullComposeUrl);
         $json_obj = getJSONobj();
         $opts = $json_obj->decode($j_quickComposeOptions);
         $opts['menu_id'] = 'dccontent';
         $ss = new Sugar_Smarty();
         $ss->assign('json_output', $json_obj->encode($opts));
         $ss->display('modules/Emails/templates/dceMenuQuickCreate.tpl');
     } else {
         $emailAddress = '';
         if (!empty($this->bean->id) && !in_array($this->bean->object_name, array('EmailMan')) && !is_null($this->bean->emailAddress)) {
             $emailAddress = $this->bean->emailAddress->getPrimaryAddress($this->bean);
         }
         echo "<script>document.location.href='mailto:{$emailAddress}';lastLoadedMenu=undefined;DCMenu.closeOverlay();</script>";
         die;
     }
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:37,代码来源:view.quickcreate.php

示例6: browse

 function browse()
 {
     $smarty = new Sugar_Smarty();
     global $mod_strings;
     $smarty->assign('mod_strings', $mod_strings);
     $smarty->assign('view_module', $this->module);
     $smarty->assign('view', $this->layout);
     if (!empty($_REQUEST['subpanel'])) {
         $smarty->assign('subpanel', $_REQUEST['subpanel']);
     }
     $stamps = array();
     global $timedate;
     $userFormat = $timedate->get_date_time_format();
     $page = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;
     $count = $this->history->getCount();
     $ts = $this->history->getNth($page * $this->pageSize);
     $snapshots = array();
     for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++) {
         $dbDate = $timedate->fromTimestamp($ts)->asDb();
         $displayTS = $timedate->to_display_date_time($dbDate);
         if ($page * $this->pageSize + $i + 1 == $count) {
             $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
         }
         $snapshots[$ts] = $displayTS;
         $ts = $this->history->getNext();
     }
     if (count($snapshots) > $this->pageSize) {
         $smarty->assign('nextPage', true);
     }
     $snapshots = array_slice($snapshots, 0, $this->pageSize, true);
     $smarty->assign('currentPage', $page);
     $smarty->assign('snapshots', $snapshots);
     $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl');
     echo $html;
 }
开发者ID:sysraj86,项目名称:carnivalcrm,代码行数:35,代码来源:view.history.php

示例7: 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');
    }
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:27,代码来源:Additions.php

示例8: 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');
 }
开发者ID:aldridged,项目名称:gtg-sugar,代码行数:8,代码来源:TopCampaignsDashlet.php

示例9: display

 function display()
 {
     global $app_strings, $current_user, $mod_strings, $theme;
     $smarty = new Sugar_Smarty();
     $type = !empty($_REQUEST['type']) ? $_REQUEST['type'] : 'main';
     $mbt = false;
     $admin = false;
     $mb = strtolower($type);
     $smarty->assign('TYPE', $type);
     $smarty->assign('app_strings', $app_strings);
     $smarty->assign('mod', $mod_strings);
     //Replaced by javascript function "setMode"
     switch ($type) {
         case 'studio':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
             require_once 'modules/ModuleBuilder/Module/StudioTree.php';
             $mbt = new StudioTree();
             break;
         case 'mb':
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=")');
             require_once 'modules/ModuleBuilder/MB/MBPackageTree.php';
             $mbt = new MBPackageTree();
             break;
         case 'dropdowns':
             // $admin = is_admin($current_user);
             require_once 'modules/ModuleBuilder/Module/DropDownTree.php';
             $mbt = new DropDownTree();
             break;
         default:
             //$smarty->assign('ONLOAD','ModuleBuilder.getContent("module=ModuleBuilder&action=home")');
             require_once 'modules/ModuleBuilder/Module/MainTree.php';
             $mbt = new MainTree();
     }
     $smarty->assign('TEST_STUDIO', displayStudioForCurrentUser());
     $smarty->assign('ADMIN', is_admin($current_user));
     $smarty->display('modules/ModuleBuilder/tpls/includes.tpl');
     if ($mbt) {
         $smarty->assign('TREE', $mbt->fetch());
         $smarty->assign('TREElabel', $mbt->getName());
     }
     $userPref = $current_user->getPreference('mb_assist', 'Assistant');
     if (!$userPref) {
         $userPref = "na";
     }
     $smarty->assign('userPref', $userPref);
     ///////////////////////////////////
     require_once 'include/SugarTinyMCE.php';
     $tiny = new SugarTinyMCE();
     $tiny->defaultConfig['width'] = 300;
     $tiny->defaultConfig['height'] = 300;
     $tiny->buttonConfig = "code,separator,bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,\n\t                         justifyfull,separator,forecolor,backcolor,\n\t                         ";
     $tiny->buttonConfig2 = "pastetext,pasteword,fontselect,fontsizeselect,";
     $tiny->buttonConfig3 = "";
     $ed = $tiny->getInstance();
     $smarty->assign("tiny", $ed);
     $smarty->display('modules/ModuleBuilder/tpls/index.tpl');
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:57,代码来源:view.main.php

示例10: getAttachmentsHtml

function getAttachmentsHtml($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;
    $smarty = new Sugar_Smarty();
    if (isset($focus->attachmentsequence)) {
        $c = get_all_linked_attachment_revisions($focus->attachmentsequence);
        // smarty mit Werten befüllen
        $smarty->assign('attachments', buildAttachmentsArray($c));
    } else {
        $smarty->assign('attachments', array());
    }
    // setup the popup link
    $popup_request_data = array('call_back_function' => 'popup_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $revision_request_data = array('call_back_function' => 'revision_return_document', 'field_to_name_array' => array("id" => "document_id", "document_name" => "document_name", "document_revision_id" => "document_revision_id", "category_id" => "document_category_id", "revision" => "revision"), 'passthru_data' => array('default_category' => $app_list_strings['document_subcategory_dom']['']));
    $json = getJSONobj();
    $encoded_request_data = $json->encode($popup_request_data);
    $encoded_revision_request_data = $json->encode($revision_request_data);
    $languageStrings = $json->encode($app_list_strings["oqc"]["Attachments"]);
    $smarty->assign('moduleName', getCurrentModuleName());
    $smarty->assign('languageStringsAttachments', $languageStrings);
    $smarty->assign('open_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('create_popup_encoded_request_data', $encoded_request_data);
    $smarty->assign('upload_revision_encoded_request_data', $encoded_revision_request_data);
    $smarty->assign('initialFilter', "\"&deleted=0\"");
    // Todo: Hier nur Dokumente zulassen, die für Vertragsanhänge erlaubt sind
    return $smarty->fetch('include/oqc/Attachments/' . $view . '.html');
}
开发者ID:santara12,项目名称:OpenQuotesAndContracts,代码行数:31,代码来源:Attachments.php

示例11: testVarReplace

 public function testVarReplace()
 {
     $params = array('subject' => 'http://example.com/[email1]', 'use_curly' => false, 'fields' => array('email1' => array('function' => array('name' => 'getEmailAddressWidget', 'returns' => 'html'), 'value' => '<!-- html -->')));
     $bean = new Account();
     $bean->email1 = 'sugar.test54203@example.com';
     $smarty = new Sugar_Smarty();
     $smarty->assign('bean', $bean);
     $output = smarty_function_sugar_replace_vars($params, $smarty);
     $this->assertContains($bean->email1, $output, 'Rendered string contains html markup.');
 }
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:10,代码来源:Bug54203Test.php

示例12: display

 function display()
 {
     require_once "include/Expressions/Dependency.php";
     require_once "include/TemplateHandler/TemplateHandler.php";
     $th = new TemplateHandler();
     $depScript = $th->createDependencyJavascript(array('phone_office' => array('calculated' => true, "formula" => 'add(strlen($name), $employees)', "enforced" => true)), array(), "EditView");
     $smarty = new Sugar_Smarty();
     $smarty->assign("dependencies", $depScript);
     $smarty->display('modules/ExpressionEngine/tpls/cfTest.tpl');
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:10,代码来源:view.cfTest.php

示例13: display

 function display()
 {
     global $mod_strings, $app_strings;
     echo get_module_title('Connectors', $mod_strings['LBL_ADMINISTRATION_MAIN'], true);
     $sugar_smarty = new Sugar_Smarty();
     $sugar_smarty->assign('mod', $mod_strings);
     $sugar_smarty->assign('app', $app_strings);
     $sugar_smarty->assign('IMG', 'themes/default/images/');
     $sugar_smarty->display('modules/Connectors/tpls/administration.tpl');
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:10,代码来源:view.connectorsettings.php

示例14: 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();
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:27,代码来源:view.exportcustomizations.php

示例15: displayOptions

 public function displayOptions()
 {
     ob_start();
     global $current_language, $app_list_strings;
     $mod_strings = return_module_language($current_language, 'AOR_Reports');
     $optionsSmarty = new Sugar_Smarty();
     $optionsSmarty->assign('MOD', $mod_strings);
     $optionsSmarty->assign('id', $this->id);
     $optionsSmarty->assign('dashletTitle', $this->title);
     $optionsSmarty->assign('aor_report_id', $this->report->id);
     $optionsSmarty->assign('aor_report_name', $this->report->name);
     $optionsSmarty->assign('onlyCharts', $this->onlyCharts);
     $charts = array();
     if (!empty($this->report->id)) {
         foreach ($this->report->get_linked_beans('aor_charts', 'AOR_Charts') as $chart) {
             $charts[$chart->id] = $chart->name;
         }
     }
     $conditions = getConditionsAsParameters($this->report, $this->params);
     $optionsSmarty->assign('parameters', $conditions);
     $chartOptions = get_select_options_with_id($charts, $this->charts);
     $optionsSmarty->assign('chartOptions', $chartOptions);
     $optionsTemplate = get_custom_file_if_exists('modules/AOR_Reports/Dashlets/AORReportsDashlet/dashletConfigure.tpl');
     ob_clean();
     return $optionsSmarty->fetch($optionsTemplate);
 }
开发者ID:omusico,项目名称:suitecrm-docker,代码行数:26,代码来源:AORReportsDashlet.php


注:本文中的Sugar_Smarty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。