本文整理匯總了PHP中ListView::setDisplayHeaderAndFooter方法的典型用法代碼示例。如果您正苦於以下問題:PHP ListView::setDisplayHeaderAndFooter方法的具體用法?PHP ListView::setDisplayHeaderAndFooter怎麽用?PHP ListView::setDisplayHeaderAndFooter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ListView
的用法示例。
在下文中一共展示了ListView::setDisplayHeaderAndFooter方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ListView
$ListView = new ListView();
$ListView->initNewXTemplate('modules/Campaigns/Schedule.html', $current_module_strings);
if ($test) {
$ListView->xTemplateAssign("SCHEDULE_MESSAGE_HEADER", $current_module_strings['LBL_SCHEDULE_MESSAGE_TEST']);
} else {
$ListView->xTemplateAssign("SCHEDULE_MESSAGE_HEADER", $current_module_strings['LBL_SCHEDULE_MESSAGE_EMAILS']);
}
//force multi-select popup
$ListView->process_for_popups = true;
$ListView->multi_select_popup = true;
//end
$ListView->mergeduplicates = false;
$ListView->show_export_button = false;
$ListView->show_select_menu = false;
$ListView->show_delete_button = false;
$ListView->setDisplayHeaderAndFooter(false);
$ListView->xTemplateAssign("RETURN_MODULE", $_POST['return_module']);
$ListView->xTemplateAssign("RETURN_ACTION", $_POST['return_action']);
$ListView->xTemplateAssign("RETURN_ID", $_POST['record']);
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_FORM_TITLE']);
$ListView->setQuery($where, "", "date_modified desc", "EMAILMARKETING", false);
if ($test) {
$ListView->xTemplateAssign("MODE", $_POST['mode']);
//finds all marketing messages that have an association with prospect list of the test.
//this query can be siplified using sub-selects.
$query = "select distinct email_marketing.id email_marketing_id from email_marketing ";
$query .= " inner join email_marketing_prospect_lists empl on empl.email_marketing_id = email_marketing.id ";
$query .= " inner join prospect_lists on prospect_lists.id = empl.prospect_list_id ";
$query .= " inner join prospect_list_campaigns plc on plc.prospect_list_id = empl.prospect_list_id ";
$query .= " where empl.deleted=0 ";
$query .= " and prospect_lists.deleted=0 ";
示例2: execute
function execute($format = 'TABLE', $parameter_values = array())
{
global $sugar_config, $current_user, $current_language;
global $beanList, $beanFiles;
$beanName = $beanList[$this->mainmodule];
$beanFile = $beanFiles[$beanName];
if (!empty($beanName) && !empty($beanFile)) {
require_once $beanFile;
$seed = new $beanName();
$filters = $this->get_filters();
$sql_where = array();
foreach ($filters as $filter) {
$sql_where[] = $filter->create_where_clause($parameter_values);
}
$orders = $this->get_orders();
$sql_order = array();
foreach ($orders as $order) {
$sql_order[] = $order->create_order_clause($parameter_values);
}
if ($this->filtertype == "AND") {
$sql_join = " and ";
} else {
if ($this->filtertype == "OR") {
$sql_join = " or ";
} else {
$sql_join = " and ";
}
}
if (!empty($sql_join) && !empty($sql_where)) {
$where_clause = "(" . join($sql_join, $sql_where) . ")";
}
if (!empty($sql_order)) {
$order_clause = join(", ", $sql_order);
}
if (!empty($this->customwhere1)) {
$where_clause = $this->customwhere1 . " " . $where_clause;
}
if (!empty($this->customwhere2)) {
$where_clause = $where_clause . " " . $this->customwhere1;
}
$rows = $seed->get_full_list($order_clause, $where_clause);
if (empty($rows)) {
$rows = array();
}
$this->report_output .= "Found " . count($rows) . " rows<br/>";
if ($format == "TABLE" || $format == "HTML" || $format == "SIMPLEHTML" || $format == "CSV") {
$list_data = array();
$list_fields = array();
foreach ($rows as $row) {
$row_data = $row->get_list_view_data();
$row_data_mapped = array();
foreach (array_keys($row_data) as $key) {
$row_data_mapped[strtoupper($this->mainmodule) . "_" . $key] = $row_data[$key];
}
$list_data[] = new ListingRow($row_data_mapped);
if (empty($list_fields)) {
foreach (array_keys($row_data) as $key) {
$list_fields[] = $key;
}
}
}
if ($format == "HTML" || $format == "TABLE") {
if ($this->list_template == "default") {
require_once 'include/ListView/ListViewSmarty.php';
if (file_exists('custom/modules/' . $this->mainmodule . '/metadata/listviewdefs.php')) {
require_once 'custom/modules/' . $this->mainmodule . '/metadata/listviewdefs.php';
} else {
require_once 'modules/' . $this->mainmodule . '/metadata/listviewdefs.php';
}
$lv = new ListViewSmarty();
$displayColumns = array();
foreach ($listViewDefs[$this->mainmodule] as $col => $params) {
if (!empty($params['default']) && $params['default']) {
$displayColumns[$col] = $params;
}
}
$lv->displayColumns = $displayColumns;
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where_clause, $params);
ob_start();
echo $lv->display();
} else {
require_once 'include/ListView/ListView.php';
$lv = new ListView();
if ($_REQUEST["is_scheduler"] = "true") {
$lv->setDisplayHeaderAndFooter(false);
}
$lv->initNewXTemplate('modules/ZuckerListingTemplate/lists/' . $this->list_template, return_module_language($current_language, $this->mainmodule));
$lv->xTemplateAssign("SITE_URL", $sugar_config["site_url"]);
ob_start();
$lv->processListViewTwo($list_data, "rows", "ROW");
}
if ($format == "HTML") {
$date = date("ymd_His");
$this->report_result_type = "FILE";
$this->report_result_name = $date . "_" . $this->name . ".html";
$this->report_result_name = strtolower(join("_", explode(" ", $this->report_result_name)));
$this->report_result = $this->archive_dir . "/" . $this->report_result_name;
$f = fopen($this->report_result, "w");
$c = file_get_contents("modules/ZuckerListingTemplate/lists/header.html");
$c = str_replace("{SITE_URL}", $sugar_config["site_url"], $c);
//.........這裏部分代碼省略.........