id_cadre);
}
protected function init_default_applied_sort() {
$this->add_applied_sort('id_cadre', 'desc');
}
/**
* Construction dynamique de la fonction JS de tri
*/
protected function get_js_sort_script_sort() {
$display = parent::get_js_sort_script_sort();
$display = str_replace('!!categ!!', 'frbr_pages', $display);
$display = str_replace('!!sub!!', '', $display);
$display = str_replace('!!action!!', 'list', $display);
return $display;
}
/**
* Affichage d'une colonne avec du HTML non calculé
* @param string $value
*/
protected function get_display_cell_html_value($object, $value) {
$search = [
"!!id_cadre!!",
];
$replace = [
$object->get_id(),
];
$value = str_replace($search, $replace, $value);
$display = "
".$value." | ";
return $display;
}
/**
* Initialisation des colonnes disponibles
*/
protected function init_available_columns() {
$this->available_columns =
array('main_fields' =>
array(
'id_cadre' => '1601',
'name' => '67',
'class_name' => 'class_name',
'num_page' => 'list_ui_frbr_page_id',
'page_name' => 'frbr_page_name',
)
);
}
/**
* Initialisation des colonnes par défaut
*/
protected function init_default_columns() {
$this->add_column('id_cadre');
$this->add_column('name');
$this->add_column('class_name');
$this->add_column('num_page');
$this->add_column('page_name');
$this->add_column_sel_button();
}
protected function init_no_sortable_columns() {
$this->no_sortable_columns = array(
'class_name',
'num_page',
'page_name',
);
}
protected function add_column_sel_button() {
global $msg;
$this->columns[] = array(
'property' => '',
'label' => "",
'html' => "
",
'exportable' => false
);
}
public static function get_controller_url_base() {
global $base_path, $action;
return $base_path.'/cms.php?categ=frbr_pages&sub=cadres&action=' . $action;
}
/**
* Initialisation des filtres de recherche
*/
public function init_filters($filters=array()) {
$this->filters = array(
'id_cadre' => '',
'num_page' => '',
'template_content' => '',
);
parent::init_filters($filters);
}
/**
* Initialisation des filtres disponibles
*/
protected function init_available_filters() {
$this->available_filters =
array('main_fields' =>
array(
'id_cadre' => '1601',
'num_page' => 'list_ui_frbr_page_id',
'template_content' => 'template_content',
)
);
$this->available_filters['custom_fields'] = array();
}
protected function init_default_selected_filters() {
$this->add_selected_filter('id_cadre');
}
protected function get_search_filter_id_cadre() {
global $charset;
return "";
}
protected function get_search_filter_num_page() {
global $charset;
return "";
}
protected function get_search_filter_template_content() {
global $charset;
return "";
}
/**
* Filtres provenant du formulaire
*/
public function set_filters_from_form() {
global $id_cadre, $num_page, $template_content;
if(isset($id_cadre)) {
$this->filters['id_cadre'] = intval($id_cadre);
}
if(isset($num_page)) {
$this->filters['num_page'] = intval($num_page);
}
if(isset($template_content)) {
$this->filters['template_content'] = stripslashes($template_content);
}
parent::set_filters_from_form();
}
/**
* Filtre SQL
*/
protected function _get_query_filters() {
$filter_query = '';
$this->set_filters_from_form();
$filters = array();
if($this->filters['id_cadre']) {
$filters[] = 'id_cadre = "'.$this->filters['id_cadre'].'"';
}
if($this->filters['num_page']) {
$filters[] = 'cadre_num_page = "'.$this->filters['num_page'].'"';
}
if($this->filters['template_content']) {
$filters[] = 'cadre_content_data LIKE "%'.$this->filters['template_content'].'%"';
}
if(count($filters)) {
$filter_query .= $this->_get_query_join_filters();
$filter_query .= ' where '.implode(' and ', $filters);
}
return $filter_query;
}
/**
* Jointure externes SQL pour les besoins des filtres
*/
protected function _get_query_join_filters() {
$filter_join_query = '';
if($this->filters['template_content']) {
$filter_join_query .= " LEFT JOIN frbr_cadres_content ON (id_cadre = cadre_content_num_cadre) ";
}
return $filter_join_query;
}
protected function get_cell_content($object, $property) {
$content = '';
switch($property) {
case 'id_cadre':
$content .= $object->get_id();
break;
case 'num_page':
$content .= $object->get_page()->get_id();
break;
case 'page_name':
$content .= $object->get_page()->get_name();
break;
default :
$content .= parent::get_cell_content($object, $property);
break;
}
return $content;
}
protected function get_display_others_actions() {
global $msg;
return "";
}
}