function plugins_base() { extract(tep_load('languages')); $this->scripts_array = $this->strings_array = array(); $this->site_index = tep_create_safe_string(tep_get_site_path(), '_', "/[^0-9a-z\\-_]+/i"); $this->key = get_class($this); $key_path = tep_trail_path($this->key); $this->web_path = DIR_WS_PLUGINS . $key_path; $this->fs_path = DIR_FS_PLUGINS . $key_path; $this->web_template_path = DIR_WS_TEMPLATE . $key_path; $this->fs_template_path = DIR_FS_TEMPLATE . $key_path; $this->fs_language_path = DIR_FS_STRINGS . tep_trail_path($lng->path) . $key_path; $this->active = $this->scripts_check(); }
function generate_string_folders() { extract(tep_load('languages', 'database', 'message_stack')); $result = true; if (empty($this->front_strings_array) && !isset($this->options_array['strings'])) { return $result; } $result = false; $present_folders = array(); $missing_folders = array(); foreach ($lng->languages as $id => $params) { $check_path = $this->admin_path . tep_trail_path($this->options_array['strings']) . $params['language_path']; if (!is_dir($check_path)) { $missing_folders[] = $check_path; } else { $file_path = tep_trail_path($check_path, true); for ($i = 0, $j = count($this->front_strings_array); $i < $j; $i++) { $file = $file_path . $this->front_strings_array[$i]; if (is_file($file)) { $present_folders[] = $check_path; break; } } } } if (empty($present_folders)) { $msg->add_session(sprintf(ERROR_PLUGIN_MISSING_STRINGS, $db->prepare_input($this->title))); return $result; } if (!empty($missing_folders)) { $present = $present_folders[0]; for ($i = 0, $j = count($missing_folders); $i < $j; $i++) { tep_copy_dir($present, $missing_folders[$i]); } $msg->add_session(sprintf(WARNING_PLUGIN_MISSING_STRINGS, $db->prepare_input($this->title)), 'warning'); } $result = true; return $result; }
</tr> <?php foreach ($plugins_compressed_array as $key => $zip_info) { $inf_link = tep_href_link($g_script, 'cplgID=' . $key . '&action=decompress'); if ($cplgID == $key) { echo ' <tr class="dataTableRowSelected">' . "\n"; } else { echo ' <tr class="dataTableRow row_link" href="' . $inf_link . '">' . "\n"; } ?> <td><?php echo $key; ?> </td> <td colspan="4" class="transtwenties"><?php echo DIR_WS_PLUGINS . tep_trail_path($key) . basename($zip_info['file']); ?> </td> <td class="ralign"> <?php if ($cplgID == $key) { echo tep_image(DIR_WS_ICONS . 'icon_arrow_right.png', $key . ' ' . TEXT_SELECTED); } else { echo '<a href="' . $inf_link . '">' . tep_image(DIR_WS_ICONS . 'icon_decompress.png', sprintf(TEXT_INFO_DECOMPRESS, basename($zip_info['file']), DIR_WS_PLUGINS . $key)) . '</a>'; } ?> </td> </tr> <?php } }
function create_download_path() { $options_array = $this->load_options(); $result = true; $dir = DIR_FS_CATALOG . tep_trail_path($options_array['download_path']); if (!empty($dir)) { $result = tep_mkdir($dir); } return $result; }
function get_string_file_path($plugin_name, $file, $physical = false) { $result_array = array(); $fs_plugins = $physical ? tep_front_physical_path(DIR_WS_CATALOG_STRINGS) : DIR_WS_CATALOG_STRINGS; foreach ($this->languages as $id => $value) { $path = $fs_plugins . tep_trail_path($value['language_path']) . tep_trail_path($plugin_name); $result_array[] = $path . $file; } return $result_array; }