"),ENT_QUOTES, $charset)."
";
$descriptors = $item->get_descriptors();
if (is_array($descriptors) && count($descriptors)) {
foreach ($descriptors as $descriptor) {
$items_xmlrss .= "
".htmlspecialchars ($descriptor['label'],ENT_QUOTES, $charset)."";
}
}
$items_xmlrss .= "
";
}
}
}
return $items_xmlrss;
}
public function get_synced_datasources(){
return $this->datasources_synced;
}
public static function get_format_data_structure(){
global $msg;
$datas = array(
array(
'var' => "id",
'desc'=> $msg['cms_module_watch_datasource_desc_id']
),
array(
'var' => "title",
'desc' => $msg['cms_module_watch_datasource_desc_title']
),
array(
'var' => "desc",
'desc' => $msg['cms_module_watch_datasource_desc_desc']
),
array(
'var' => "logo",
'children' => docwatch_root::prefix_var_tree(docwatch_logo::get_format_data_structure(),"logo"),
'desc' => $msg['cms_module_watch_datasource_desc_logo']
),
array(
'var' => "logo_url",
'desc' => $msg['cms_module_watch_datasource_desc_logo_url']
),
array(
'var' => "last_date",
'desc' => $msg['cms_module_watch_datasource_desc_last_date']
),
array(
'var' => "rss_link",
'desc' => $msg['cms_module_watch_datasource_desc_rss_link']
),
array(
'var' => "category",
'desc' => $msg['cms_module_watch_datasource_desc_category'],
'children' => array(
array(
'var' => "category.id",
'desc' => $msg['cms_module_watch_datasource_desc_category_id']
),
array(
'var' => "category.title",
'desc' => $msg['cms_module_watch_datasource_desc_category_title']
)
)
),
array(
'var' => "items",
'desc' => $msg['cms_module_watch_datasource_desc_items'],
'children' => docwatch_root::prefix_var_tree(docwatch_item::get_format_data_structure(), "items[i]")
)
);
return $datas;
}
/**
* Méthode appellée après le fetch_datas
* @return true if user have rights, false otherwise
*/
public function check_rights(){
global $PMBuserid;
if(in_array(SESSuserid, $this->allowed_users) || $PMBuserid == 1){
return true;
}
return false;
}
public static function check_watch_rights($watch_id){
global $PMBuserid;
if($watch_id){
$query = "select watch_allowed_users from docwatch_watches where id_watch = '".$watch_id."'";
$result = pmb_mysql_query($query);
if(pmb_mysql_num_rows($result)){
$row = pmb_mysql_fetch_object($result);
$tab_users = explode(",",$row->watch_allowed_users);
}
if(in_array(SESSuserid, $tab_users) || $PMBuserid == 1){
return true;
}
return false;
}else{
return true;
}
}
public function get_error(){
return $this->error;
}
} // end of docwatch_watch
|