Пример: aviaport_image_gallery

 
+
-
edit
 

Balancer

администратор
★★★★★
code php
  1. <?php
  2.  
  3. class aviaport_image_gallery extends base_page_db
  4. {
  5.     function main_table_storage() { return 'aviaport_image_gallery'; }
  6.     function main_db_storage() { return 'WWW'; }
  7.     function storage_engine() { return 'storage_db_mysql_smart'; }
  8.     function class_type() { return ec('Фотоотчёт'); }
  9.  
  10.     function main_table_fields()
  11.     {
  12.         return array(
  13.             'id',
  14.             'title',
  15.             'description',
  16.             'author_name',
  17.             'create_time',
  18.             'modify_time',
  19.             'default_image_id' => 'default_image',
  20.             'report_time',
  21.             'place_id',
  22.             'show_on_main',
  23.         );
  24.     }
  25.  
  26.     function url($page=NULL) { return config('main_host_url').'/images/archive/'.$this->id().($page && $page != 1 ? ','.$page : '').'/'; }
  27.  
  28.     function admin_url() { return config('admin_host_url').'/images/gallery/'.$this->id().'/'; }
  29.  
  30.     function default_image()
  31.     {
  32.         return object_load('aviaport_image', $this->default_image_id());
  33.     }
  34.  
  35.     function data_providers()
  36.     {
  37.         $this->add_template_data('banner_right_zone', 108);
  38.         $this->add_template_data('right_menu', 'right-menu/gallery.html');
  39.         $this->add_template_data('skip_gallery', $this->id());
  40.         return array('images_list' => bors_get_cross_objs(object_load('aviaport_image_gallery', $this->id())));
  41.     }
  42. }
 

в начало страницы | новое
 
Поиск
Настройки
Твиттер сайта
Статистика
Рейтинг@Mail.ru