本文整理匯總了PHP中Gallery::multiple方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gallery::multiple方法的具體用法?PHP Gallery::multiple怎麽用?PHP Gallery::multiple使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gallery
的用法示例。
在下文中一共展示了Gallery::multiple方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gallery
function gallery($field_name = false, $size = false, $thumbnails = 0, $class = false, $limit = 0, $encrypted = false, $alt_field = false)
{
global $CFG;
if ($CFG->pm_editor) {
$method_name = self::peLabel($CFG->method_id, 'gallery');
}
$this->HTML[] = $method_name . Gallery::multiple($this->table . '_files', $this->record_id, $field_name, $size, $thumbnails, $class, $limit, false, false, false, false, false, false, false, false, false, false, $encrypted, $alt_field);
}
示例2: display
function display($page = 0)
{
global $CFG;
$filters = self::getFilterResults();
$page = $page > 0 ? $page : $_SESSION['page' . $this->i];
$_SESSION['page' . $this->i] = $page;
$page = !($page > 0) || $_REQUEST['submit'] || $this->order_asc_changed || $this->order_by_changed ? 1 : $page;
$fields = DB::getTableFields($this->table);
$total_rows = DB::get($this->table, $this->fields, $page, $this->rows_per_page, $this->order_by, $this->order_asc, 1, $filters, $this->inset_id, $this->inset_id_field, false, false, false, false, false, false, false, $this->sql_filter, $this->group_by, $this->no_group_by);
$data = DB::get($this->table, $this->fields, $page, $this->rows_per_page, $this->order_by, $this->order_asc, 0, $filters, $this->inset_id, $this->inset_id_field, false, false, false, false, false, false, false, $this->sql_filter, $this->group_by, $this->no_group_by);
$HTML = "";
if ($CFG->backstage_mode && User::permission(0, 0, $this->link_url, false, $this->is_tab) > 1 && $this->inset_id === false) {
$HTML .= '
<form id="grid_form_' . $this->table . $this->i . '" name="grid_form_' . $this->table . $this->i . '" action="' . $CFG->self . '" method="POST">
<input type="hidden" name="current_url" value="' . $CFG->url . '" />
<input type="hidden" name="action" value="" />
<input type="hidden" name="return_to_self" value="1" />';
if (is_array($this->fields)) {
foreach ($this->fields as $properties) {
if ($properties['aggregate_function']) {
$i_name = $properties['name'];
switch ($properties['aggregate_function']) {
case 'grand_total':
$grand_total[$i_name] = 0;
break;
case 'page_total':
$page_total[$i_name] = 0;
break;
case 'grand_avg':
$grand_avg[$i_name] = array();
break;
case 'page_avg':
$page_avg[$i_name] = array();
break;
case 'both_total':
$page_total[$i_name] = 0;
$grand_total[$i_name] = 0;
break;
case 'both_avg':
$page_avg[$i_name] = array();
$grand_avg[$i_name] = array();
break;
}
}
}
}
if (is_array($this->fields)) {
foreach ($this->fields as $properties) {
if ($properties['cumulative_function']) {
$i_name = $properties['name'];
if ($properties['cumulative_function'] == 'sum') {
$page_total[$i_name] = 0;
if ($grand_total) {
$grand_total[$i_name] = 0;
}
} elseif ($properties['cumulative_function'] == 'avg') {
$page_avg[$i_name] = array();
if ($grand_avg) {
$grand_avg[$i_name] = array();
}
}
}
}
}
}
if ($this->mode == 'list') {
$HTML .= "<ul class=\"grid_list\">";
if (is_array($data)) {
$j = 0;
foreach ($data as $row) {
$HTML .= "<li><ul>";
if (is_array($this->fields)) {
foreach ($this->fields as $name => $properties) {
$key = $name;
if (strstr($name, 'lll')) {
$name_parts = explode('lll', $name);
$name = $name_parts[0];
}
if ($this->inset_id > 0 && $name == $this->inset_id_field) {
continue;
}
$value = $row[$key];
$link_id = $row[$name . '_id'] ? $row[$name . '_id'] : $value;
$class = $properties['class'] ? "class=\"{$properties['class']}\"" : '';
if ($CFG->pm_editor) {
$method_name = Form::peLabel($properties['method_id'], 'field');
}
$HTML .= "<li {$class}>" . $method_name . "";
if (!empty($properties['is_media'])) {
reset($CFG->image_sizes);
$m_values = explode('|||', $value);
$m_size = !empty($properties['media_size']) ? $properties['media_size'] : key($CFG->image_sizes);
$m_limit = !empty($properties['media_amount']) ? $properties['media_amount'] : 1;
$HTML .= Gallery::multiple($properties['subtable'], $row['id'], $properties['name'], $properties['media_size'], 0, false, $properties['media_amount'], false, false, true);
$HTML .= '<div class="clear"></div>';
} else {
if ($fields[$name]['Type'] == 'datetime' || @in_array($name, $foreign_dates)) {
$value = date($CFG->default_date_format, strtotime($value));
} elseif ($fields[$name]['Type'] == "enum('Y','N')") {
$value = $value == 'Y' ? '<div class="y_icon"></div>' : '<div class="n_icon"></div>';
//.........這裏部分代碼省略.........