Exemple #1
0
 function image_convert($image)
 {
     return ENHANCE::image_transform($image, array(100, 100), null, null);
 }
Exemple #2
0
 function price_objects_render($cat_id, $level = 0, $hashed_links = 0, $show_counters = 0, $max_level = 0)
 {
     global $TMS, $_PATH, $TPA;
     $buff = '';
     $category = $this->_tree->getNodeInfo($cat_id);
     $items = $this->_tree->GetChildsParam($cat_id, array('file_name', 'basic', 'LastModified', 'description', 'image', 'hashed_link', 'hash', 'hidden', 'DisableAccess', 'counter'), true);
     Common::is_module_exists("fusers") ? $fusers_exists = true : ($fusers_exists = false);
     $session = ENHANCE::get_session('');
     $fusers = false;
     if ($category["params"]["DisableAccess"] && $fusers_exists) {
         Common::call_common_instance('fusers');
         $fusers = fusers_module_common::getInstance();
         $found = false;
         if ($session["siteuser"]["usergroup"]) {
             $found = $fusers->get_node_rights($cat_id, $this->_module_name, $session["siteuser"]["usergroup"]);
         }
         if (!$found) {
             return $TMS->parseSection('_doc_list_no_access');
         }
     }
     $TMS->AddReplace('_doc_list_level_' . $level, 'cat_name', $category["basic"]);
     if ($items != false) {
         foreach ($items as $item) {
             if ($item["params"]["hidden"]) {
                 continue;
             }
             if ($item["obj_type"] == '_PRICEGROUP') {
                 if ($level < $max_level - 1 || !$max_level) {
                     if ($hashed_links || $category["params"]["hashed_link"]) {
                         $buff .= $this->price_objects_render($item['id'], $level + 1, 1, $show_counters);
                     } else {
                         $buff .= $this->price_objects_render($item['id'], $level + 1, 0, $show_counters);
                     }
                 }
                 continue;
             }
             if (!file_exists($f = PATH_ . $item['params']['file_name'])) {
                 $buff .= $TMS->parseSection('_file_not_found');
                 continue;
             }
             if ($item['params']['DisableAccess'] && $fusers_exists) {
                 if (!$fusers) {
                     Common::call_common_instance('fusers');
                     $fusers = fusers_module_common::getInstance();
                 }
                 $found = false;
                 if ($session["siteuser"]["usergroup"]) {
                     $found = $fusers->get_node_rights($item['id'], $this->_module_name, $session["siteuser"]["usergroup"]);
                 }
                 if (!$found) {
                     $buff .= $TMS->parseSection('_file_no_access');
                 }
             }
             $stat = stat($f);
             if ($hashed_links || $item["params"]["hashed_link"] || $category["params"]["hashed_link"]) {
                 $alink = $TPA->page_link . '/~download/link/' . $item["params"]["hash"];
                 $item['params']['counter'] ? $acounter = $item['params']['counter'] : ($acounter = 0);
             } else {
                 $alink = $_PATH['WEBPATH_MEDIA'] . $item['params']['file_name'];
                 $acounter = '';
             }
             $TMS->AddMassReplace('_doc_list_item_level_' . $level, array("link" => $alink, "counter" => $acounter, "type" => pathinfo($item['params']['file_name'], PATHINFO_EXTENSION), "caption" => $item['params']['basic'], "image" => $a['image'] = $item['params']['image'], "description" => $item['params']['description'], "time" => date('d.m.Y', $item['params']['LastModified']), "show_counters" => $show_counters, "size" => XFILES::format_size($stat['size'])));
             $buff .= $TMS->parseSection('_doc_list_item_level_' . $level);
         }
     }
     $TMS->AddReplace("_doc_list_level_" . $level, "buff", $buff);
     $TMS->AddReplace("_doc_list_level_" . $level, "show_counters", $show_counters);
     $TMS->AddMassReplace('_doc_list_level_' . $level, $category['params']);
     $menu = $TMS->parseSection('_doc_list_level_' . $level);
     return $menu;
 }
Exemple #3
0
 function image_transform_return($params, $section)
 {
     $img = array_shift($params);
     return ENHANCE::image_transform($img, $params, $section);
 }
Exemple #4
0
 function property_set_to_properties_manager($pset, $properties, $props_types)
 {
     foreach ($props_types as $name => $pt) {
         if ($pt == 'CATOBJ') {
             $this->_tree->FullBonesMas = null;
             $this->_tree->GetFullBonesUp($properties[$name]);
             $result[$name] = $properties[$name];
             if ($this->_tree->FullBonesMas) {
                 $path = implode('/', XARRAY::arr_to_lev($this->_tree->FullBonesMas, 'id', 'params', 'Name'));
                 $result[$name] = $path;
             }
         } elseif ($pt == 'IMAGE') {
             $result[$name] = ENHANCE::image_transform($properties[$name], array(50, 50), null, null);
         } elseif ($pt == 'DATE') {
             $result[$name] = date('d-m-Y', $properties[$name]);
         } else {
             $result[$name] = $properties[$name];
         }
     }
     return $result;
 }