Esempio n. 1
0
 function install_css_menu()
 {
     parent::plug_manager();
     $this->options_array = array('max_cols' => 2, 'max_drop' => 10, 'max_width' => 380, 'border_width' => 2, 'font_size' => 10, 'font_pad' => 0, 'template' => 'stock');
     // Never set the key member
     $this->title = 'CSS Menu';
     $this->author = 'Mark Samios';
     $this->version = '1.01';
     $this->framework = '1.12';
     $this->help = '';
     // Brief description of a plugin or use a file
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 0;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path relative to the plugins directory (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/css_menu.php' => $this->web_path . 'css_menu.php');
     // Common Template filenames
     $this->template_array = array('css_menu.css' => $this->web_template_path . 'css_menu.css', 'css_menu.tpl' => $this->web_template_path . 'css_menu.tpl', 'words_space.gif' => $this->web_template_path . 'words_space.gif');
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 2
0
 function install_direct_management()
 {
     $this->admin_min_key_length = 10;
     parent::plug_manager();
     $this->options_array = array('text_pages' => 1, 'text_collections' => 1, 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT), 'admin_key' => 'admin_key', 'admin_key_length' => $this->admin_min_key_length);
     // Never set the key member
     $this->title = 'Direct Management';
     // Text title of the Plugin shows on the admin
     $this->author = 'Mark Samios';
     // Your name/author
     $this->version = '1.00';
     // Plugin Version
     $this->framework = '1.12';
     // Minimum version of the I-Metrics CMS required
     $this->help = '';
     // Brief description of a plugin or use a file
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     // Operates on front-end
     $this->back = 1;
     // Do not operates on admin-end
     $this->status = 1;
     // enable plugin after installation
     $this->files_array = array('front/direct_management.php' => $this->web_path . 'direct_management.php', 'front/direct_management.tpl' => $this->web_path . 'direct_management.tpl', 'front/web_strings.php' => $this->web_path . 'web_strings.php', 'front/admin.js' => $this->web_path . 'admin.js', 'front/admin.tpl' => $this->web_path . 'admin.tpl', 'front/dm_edit.png' => $this->web_path . 'dm_edit.png');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array();
     // Setup plugin configuration options using a template file
     $this->config_form = $this->admin_path . 'config_form.tpl';
     // Load string for the installation/configuration from a file
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 3
0
 function install_popup_image()
 {
     parent::plug_manager();
     $this->options_array = array('front_scripts' => array(), 'front_all' => true, 'front_common_selector' => 'div.imagelink a', 'back_scripts' => array(), 'back_all' => false, 'back_common_selector' => 'div#help_image_group a');
     $this->front_common_selector = 'div.imagelink a';
     $this->back_common_selector = 'div#help_image_group a';
     // Never set the key member
     $this->title = 'Fancybox Popup Image';
     $this->author = 'Mark Samios';
     $this->icon = 'popup.png';
     $this->version = '1.01';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path relative to the plugins directory (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/popup_image.php' => $this->web_path . 'popup_image.php', 'front/launcher.tpl' => $this->web_path . 'launcher.tpl');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array();
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
 function html_end()
 {
     extract(tep_load('defs', 'database'));
     // Setup help script - default js help is loaded by system_base
     $script_name = tep_get_script_name();
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $postfix = 'list';
     switch ($cDefs->action) {
         case 'verify':
             $posfix = 'verify';
             break;
         default:
             break;
     }
     $title = $this->get_system_help_title($postfix);
     $contents_array = array('POPUP_TITLE' => $title, 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     // process js template
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 5
0
 function install_right_column()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->options_array = array('text_pages' => 1, 'text_collections' => 1, 'image_collections' => 1, 'template' => 'stock', 'strings' => 'front', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_LANGUAGES_SYNC, FILENAME_RIGHT_CONTENT));
     $this->title = 'Right Column';
     $this->author = 'Mark Samios';
     $this->icon = 'right_column.png';
     $this->version = '1.02';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // $this->web_path points to the plugins folder of the webfront
     // Key/Left => Source Path/File (to copy file from)
     // Value/Right => Destination Path only (to copy source file to)
     $this->files_array = array('front/right_column.php' => $this->web_path . 'right_column.php', 'front/defs.php' => $this->web_path . 'defs.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_right_content.php' => 'right_content.php', 'back/admin_right_content_strings.php' => DIR_WS_STRINGS . 'right_content.php');
     // Common Template filenames
     $this->template_array = array('right_collection.tpl' => $this->web_template_path . 'right_collection.tpl', 'right_text.tpl' => $this->web_template_path . 'right_text.tpl', 'right_box.tpl' => $this->web_template_path . 'right_box.tpl');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 6
0
 function install_download_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $front_defs = tep_web_files('FILENAME_GENERIC_PAGES', 'FILENAME_COLLECTIONS');
     // Default Options
     $this->options_array = array('text_pages' => 1, 'collections' => 1, 'display_col' => 1, 'download_count' => 1, 'download_count_show' => 1, 'download_path' => 'pub/', 'download_method' => 'get', 'default_status' => 1, 'template' => 'stock', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_DOWNLOAD), 'fscripts' => array_values($front_defs));
     $this->title = 'Download System';
     $this->author = 'Mark Samios';
     $this->icon = 'download.png';
     $this->version = '1.00';
     $this->framework = '1.12';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/download_system.php' => $this->web_path . 'download_system.php', 'front/tables.php' => $this->web_path . 'tables.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_download.php' => 'download.php', 'back/admin_download_strings.php' => DIR_WS_STRINGS . 'download.php');
     // Common Template filenames
     $this->template_array = array('web_strings.php' => $this->web_template_path . 'web_strings.php', 'download_form.tpl' => $this->web_template_path . 'download_form.tpl', 'download_text.tpl' => $this->web_template_path . 'download_text.tpl');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 7
0
 function get_help()
 {
     extract(tep_load('defs', 'database', 'sessions'));
     $result = false;
     $zone_script = '';
     if (isset($_GET['zID']) && tep_not_null($_GET['zID'])) {
         $zone_query = $db->query("select seo_types_class from " . TABLE_SEO_TYPES . " where seo_types_id = '" . (int) $_GET['zID'] . "'");
         if ($db->num_rows($zone_query)) {
             $zone_array = $db->fetch_array($zone_query);
             $zone_script = $zone_array['seo_types_class'];
         }
     }
     if (!empty($zone_script)) {
         $file = DIR_FS_STRINGS . 'help/' . $zone_script . '.php';
     } else {
         $file = DIR_FS_STRINGS . 'help/' . $cDefs->script;
     }
     $result = tep_read_contents($file, $contents);
     if (!$result) {
         return $result;
     }
     echo $contents;
     $cSessions->close();
     return true;
 }
Esempio n. 8
0
 function install_comments_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $this->options_array = array('text_pages' => 1, 'text_collections' => 1, 'image_collections' => 1, 'mixed_collections' => 0, 'display_rating' => true, 'rating_steps' => 5, 'text_include' => false, 'collection_include' => true, 'anti_bot' => false, 'anti_bot_strict' => false, 'auto_display' => 1, 'rss' => true, 'strings' => 'front', 'template' => 'stock', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_COMMENTS));
     $this->title = 'Comments System';
     $this->author = 'Mark Samios';
     $this->icon = 'comments.png';
     $this->version = '1.01';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     $this->default_steps = 5;
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/comments_system_css.php' => DIR_WS_CATALOG . 'comments_system_css.php', 'front/comments_system_rss.php' => DIR_WS_CATALOG . 'comments_system_rss.php', 'front/comments_system.php' => $this->web_path . 'comments_system.php', 'front/defs.php' => $this->web_path . 'defs.php', 'front/cscss.css' => $this->web_path . 'cscss.css');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_comments.php' => 'comments.php', 'back/admin_comments_strings.php' => DIR_WS_STRINGS . 'comments.php');
     // Common Template filenames
     $this->template_array = array('comments_form.tpl' => $this->web_template_path . 'comments_form.tpl', 'comments_posted.tpl' => $this->web_template_path . 'comments_posted.tpl', 'thumbs-up.png' => $this->web_template_path . 'thumbs-up.png', 'thumbs-down.png' => $this->web_template_path . 'thumbs-down.png');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 9
0
 function install_newsletter_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     $front_defs = tep_web_files('FILENAME_DEFAULT', 'FILENAME_GENERIC_PAGES', 'FILENAME_COLLECTIONS');
     // Default Options
     $this->options_array = array('email_id' => 0, 'resent' => 0, 'display_col' => 1, 'email_limit' => 100, 'statistics' => 1, 'template' => 'stock', 'strings' => 'front', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_NEWSLETTERS), 'fscripts' => array_values($front_defs));
     $this->title = 'Newsletter System';
     $this->author = 'Mark Samios';
     $this->icon = 'newsletter.png';
     $this->version = '1.00';
     $this->framework = '1.12';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/newsletter_feedback.php' => DIR_WS_CATALOG . 'newsletter_feedback.php', 'front/newsletter_system.php' => $this->web_path . 'newsletter_system.php', 'front/tables.php' => $this->web_path . 'tables.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_newsletters.php' => 'newsletters.php', 'back/admin_newsletters_strings.php' => DIR_WS_STRINGS . 'newsletters.php');
     // Common Template filenames
     $this->template_array = array('newsletter_form.tpl' => $this->web_template_path . 'newsletter_form.tpl');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 10
0
 function install_banner_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     // Default Options
     $this->options_array = array('banners_path' => 'images/banners/', 'display_left' => 1, 'display_right' => 1, 'display_top' => 1, 'display_bottom' => 1, 'clicks' => 1, 'impressions' => 1, 'template' => 'stock', 'strings' => 'front', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_LANGUAGES_SYNC, FILENAME_BANNERS));
     $this->title = 'Banner System';
     $this->author = 'Mark Samios';
     $this->icon = 'banner.png';
     $this->version = '1.00';
     $this->framework = '1.12';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/banner_system.php' => $this->web_path . 'banner_system.php', 'front/defs.php' => $this->web_path . 'defs.php', 'front/banner_system.js' => $this->web_path . 'banner_system.js', 'front/launcher.tpl' => $this->web_path . 'launcher.tpl');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_banners.php' => 'banners.php', 'back/admin_banners_strings.php' => DIR_WS_STRINGS . 'banners.php');
     // Common Template filenames
     $this->template_array = array('banner.tpl' => $this->web_template_path . 'banner.tpl');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 11
0
 function install_voting_system()
 {
     parent::plug_manager();
     tep_define_vars($this->admin_path . 'back/admin_defs.php');
     // Default Options
     $this->options_array = array('display_col' => 1, 'display_box' => 1, 'display_mod' => 1, 'text_pages' => 1, 'text_collections' => 1, 'image_collections' => 1, 'box_steps' => 2, 'mod_steps' => 2, 'strings' => 'front', 'template' => 'stock', 'abox' => true, 'ascripts' => array(FILENAME_DEFAULT, FILENAME_VOTES));
     $this->title = 'Voting System';
     $this->author = 'Mark Samios';
     $this->version = '1.01';
     $this->framework = '1.12';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 1;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     $this->default_box_steps = 2;
     $this->default_mod_steps = 5;
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/voting_system.php' => $this->web_path . 'voting_system.php', 'front/defs.php' => $this->web_path . 'defs.php');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array('back/admin_votes.php' => 'votes.php', 'back/admin_votes_strings.php' => DIR_WS_STRINGS . 'votes.php');
     // Common Template filenames
     $this->template_array = array('votes_form.tpl' => $this->web_template_path . 'votes_form.tpl', 'thumbs-up.png' => $this->web_template_path . 'thumbs-up.png', 'thumbs-down.png' => $this->web_template_path . 'thumbs-down.png');
     $this->front_strings_array = array('web_strings.php');
     $this->sql_file = $this->admin_path . 'database.sql';
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 12
0
 function html_end()
 {
     extract(tep_load('defs'));
     $contents = '';
     $launcher = $this->web_path . 'launcher.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return $result;
     }
     $contents_array = array('BANNER_ATAG' => 'a.banner_system', 'BANNER_SEL' => '.banner_class', 'BASE_URL' => FILENAME_DEFAULT);
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 13
0
 function html_end()
 {
     extract(tep_load('defs'));
     $script_name = tep_get_script_name();
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 14
0
 function html_end()
 {
     extract(tep_load('defs'));
     // Setup help script - default js help is loaded by system_base
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     // process js template
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 15
0
 function html_end()
 {
     extract(tep_load('defs'));
     if (!$this->check_scripts()) {
         return false;
     }
     $contents = '';
     $launcher = $this->admin_path . 'back/launcher.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.plugins_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
 function html_end()
 {
     extract(tep_load('defs'));
     $script_name = tep_get_script_name();
     ob_start();
     require PLUGINS_ADMIN_PREFIX . $script_name . '.tpl';
     $contents = ob_get_contents();
     ob_end_clean();
     $cDefs->media[] = $contents;
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => HEADING_HELP_TITLE, 'POPUP_SELECTOR' => 'div.help_page  a.heading_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 17
0
 function html_end()
 {
     extract(tep_load('defs'));
     $result = false;
     if ($this->options['back_all'] || isset($this->options['back_scripts'][$cDefs->script])) {
         $contents = '';
         $launcher = $this->admin_path . 'launcher.tpl';
         $result = tep_read_contents($launcher, $contents);
         if ($result) {
             if (isset($this->options['back_scripts'][$cDefs->script])) {
             } else {
                 $selector = $this->options['back_common_selector'];
             }
             $contents_array = array('POPUP_IMAGE_SELECTOR' => $selector);
             $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
         }
     }
     return $result;
 }
Esempio n. 18
0
 function html_end()
 {
     extract(tep_load('defs', 'sessions'));
     $gID = isset($cDefs->link_params['gID']) ? (int) $cDefs->link_params['gID'] : TEMPLATE_SYSTEM_GROUP;
     $script_name = tep_get_script_name();
     ob_start();
     require PLUGINS_ADMIN_PREFIX . $script_name . '.tpl';
     $contents = ob_get_contents();
     ob_end_clean();
     $cDefs->media[] = $contents;
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
 function html_end()
 {
     extract(tep_load('defs', 'database'));
     $contents = '';
     $launcher = DIR_FS_PLUGINS . 'common_help.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $title = HEADING_HELP_TITLE;
     $gID = isset($_GET['gID']) ? (int) $_GET['gID'] : 0;
     $group_query = $db->query("select configuration_group_title from " . TABLE_CONFIGURATION_GROUP . " where configuration_group_id = '" . (int) $gID . "'");
     if ($db->num_rows($group_query)) {
         $group_array = $db->fetch_array($group_query);
         $title .= ' - ' . $group_array['configuration_group_title'];
     }
     $contents_array = array('POPUP_TITLE' => $title, 'POPUP_SELECTOR' => 'div.help_page a.heading_help');
     // process js template
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 20
0
 function install_left_column()
 {
     parent::plug_manager();
     $this->title = 'Left Column';
     $this->author = 'Mark Samios';
     $this->version = '1.00';
     $this->framework = '1.11';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 0;
     $this->status = 1;
     $this->template_path = 'front/templates/';
     // $this->web_path points to the plugins folder of the webfront
     // Key/Left => Source Path/File (to copy file from)
     // Value/Right => Destination Path only (to copy source file to)
     $this->files_array = array('front/left_column.php' => $this->web_path . 'left_column.php');
     // Common Template filenames
     $this->template_array = array('left_collection.tpl' => $this->web_template_path . 'left_collection.tpl', 'left_text.tpl' => $this->web_template_path . 'left_text.tpl', 'web_strings.php' => $this->web_template_path . 'web_strings.php');
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
 function html_end()
 {
     extract(tep_load('defs', 'sessions'));
     if (!$this->check_scripts($this->scripts_array)) {
         return false;
     }
     $cStrings =& $this->strings;
     ob_start();
     require $this->admin_path . 'back/jscripts.tpl';
     $contents = ob_get_contents();
     ob_end_clean();
     $cDefs->media[] = $contents;
     $contents = '';
     $launcher = $this->admin_path . 'back/launcher.tpl';
     $result = tep_read_contents($launcher, $contents);
     if (!$result) {
         return false;
     }
     $script_name = tep_get_script_name();
     $contents_array = array('POPUP_TITLE' => '', 'POPUP_SELECTOR' => 'div.help_page a.plugins_help');
     $cDefs->media[] = tep_templates_replace_entities($contents, $contents_array);
     return true;
 }
Esempio n. 22
0
 function install_text_gradient()
 {
     parent::plug_manager();
     // Never set the key member
     $this->title = 'Text Gradient';
     $this->author = 'Mark Samios';
     $this->version = '1.00';
     $this->framework = '1.11';
     $this->help = '';
     tep_read_contents($this->admin_path . 'readme.txt', $this->help);
     $this->front = 1;
     $this->back = 0;
     $this->status = 1;
     // The array of files that operate on the web-front
     // Left(Key)     => Source File with Path relative to the plugins directory (to copy file from)
     // Right(Value)  => Destination Path and File (to copy source file to)
     $this->files_array = array('front/text_gradient.php' => $this->web_path . 'text_gradient.php', 'gradient/launcher.tpl' => $this->web_path . 'gradient/launcher.tpl', 'gradient/jquery.textgrad0.js' => $this->web_path . 'gradient/jquery.textgrad0.js');
     // The array of files that operate on the administration end
     // Left(Key)     => Source Path/File (to copy file from)
     // Right(Value)  => Destination Path only (to copy source file to)
     $this->admin_files_array = array();
     $this->config_form = $this->admin_path . 'config_form.tpl';
     $this->strings = tep_get_strings($this->admin_path . 'strings.php');
 }
Esempio n. 23
0
 function html_end()
 {
     global $g_script, $g_media;
     $contents = '';
     $launcher = $this->web_path . 'gradient/launcher.tpl';
     $result = tep_read_contents($launcher, $contents);
     if ($result) {
         if (isset($this->options['front_scripts'][$g_script])) {
             $selector = $this->options['front_scripts'][$g_script]['selector'];
             $colors = $this->options['front_scripts'][$g_script]['colors'];
             $colors_array = explode('|', $colors);
             $contents_array = array('TEXT_GRADIENT_SELECTOR' => $selector, 'TEXT_GRADIENT_START' => $colors_array[0], 'TEXT_GRADIENT_END' => $colors_array[1]);
             $g_media[] = tep_templates_replace_entities($contents, $contents_array);
         }
         if ($this->options['front_all']) {
             $selector = $this->options['front_common_selector'];
             $colors = $this->options['front_common_colors'];
             $colors_array = explode('|', $colors);
             $contents_array = array('TEXT_GRADIENT_SELECTOR' => $selector, 'TEXT_GRADIENT_START' => $colors_array[0], 'TEXT_GRADIENT_END' => $colors_array[1]);
             $g_media[] = tep_templates_replace_entities($contents, $contents_array);
         }
     }
     return $result;
 }
Esempio n. 24
0
    echo HEADING_TITLE;
    ?>
</h1></div>
          </div>
          <div class="comboHeading">
            <div><h2><?php 
    echo TEXT_INFO_IN_FOLDER . '&nbsp;' . $path_string;
    ?>
</h2></div>
          </div>
<?php 
    $file_contents = '';
    if ($action == 'new_file') {
        $filename_input_field = TEXT_INFO_NEW_FILE;
    } elseif ($action == 'edit') {
        tep_read_contents($current_path_file, $file_contents);
        $filename_input_field = TEXT_INFO_EDIT_FILE . '&nbsp;<span class="required">' . $current_file . '</span>';
    }
    ?>
          <div class="formArea hideover"><?php 
    echo tep_draw_form('new_file', $g_script, tep_get_all_get_params('action') . 'action=save');
    ?>
<fieldset><legend><?php 
    echo $filename_input_field;
    ?>
</legend>
<?php 
    if ($action == 'new_file') {
        ?>
            <label for="file_title"><?php 
        echo TEXT_INFO_FILENAME;
Esempio n. 25
0
 function create_zip_file($zip_array)
 {
     extract(tep_load('message_stack'));
     if (!isset($_POST['zip']) || empty($zip_array)) {
         return;
     }
     $pdir = DIR_FS_PLUGINS . $this->key . '/';
     $zip_file = $pdir . $this->key . '.zip';
     $root_array = array_filter(glob($pdir . '*'), 'is_file');
     foreach ($root_array as $value) {
         $value = strtolower(basename($value));
         $value = preg_replace('/\\s\\s+/', ' ', trim($value));
         $value = preg_replace("/[^0-9a-z\\-_.\\/]+/i", '_', strtolower($value));
         if (substr($value, -4) == '.zip') {
             continue;
         }
         $input_file = $pdir . $value;
         if (!tep_read_contents($pdir . $value, $contents)) {
             $msg->add_session(sprintf(ERROR_INVALID_FILE, $input_file));
             continue;
         }
         $zip_array[$value] = $contents;
     }
     $zip_data = tep_compress($zip_array);
     if (!tep_write_contents($zip_file, $zip_data)) {
         $msg->add_session(sprintf(ERROR_WRITING_FILE, $zip_file));
     }
 }
Esempio n. 26
0
             $template = $g_db->fetch_array($template_query);
             if (isset($_POST['template_title']) && !empty($_POST['template_title'])) {
                 $template['template_title'] = $g_db->filter($_POST['template_title']);
             }
             $sql_data_array = array('group_id' => $template['group_id'], 'template_title' => $template['template_title'], 'template_subject' => $template['template_subject'], 'template_content' => $template['template_content']);
             $g_db->perform(TABLE_TEMPLATES, $sql_data_array);
             $template_id = $g_db->insert_id();
         }
     }
     tep_redirect(tep_href_link($g_script, 'tID=' . $template_id));
     break;
 case 'template_preview':
     break;
 case 'template_upload':
     $cFile = new upload('template_file');
     if (!$cFile->parse() || !tep_read_contents($cFile->tmp_filename, $template_content)) {
         $messageStack->add_session(ERROR_TEMPLATE_FILE_READ);
         tep_redirect(tep_href_link($g_script, tep_get_all_get_params('action') . 'action=new_template'));
     }
     $action = 'new_template';
     break;
 case 'template_download':
     if (empty($tID)) {
         $messageStack->add_session(ERROR_TEMPLATE_INVALID);
         tep_redirect(tep_href_link($g_script, tep_get_all_get_params('action', 'tID')));
     }
     $template_query = $g_db->query("select template_title, template_content from " . TABLE_TEMPLATES . " where template_id = '" . (int) $tID . "'");
     if (!$g_db->num_rows($template_query)) {
         $messageStack->add_session(ERROR_TEMPLATE_INVALID);
         tep_redirect(tep_href_link($g_script, tep_get_all_get_params('action', 'tID')));
     }
Esempio n. 27
0
 $entry_array = $g_db->fetch_array($entry_query);
 if (!empty($entry_array['body'])) {
     $main_body .= $entry_array['body'];
 } else {
     $main_body .= $entry_array['text_body'];
 }
 if ($unsafe == 1) {
     echo $main_body;
 } else {
     $contents = '';
     $attachments_query = $g_db->query("select attachment from " . TABLE_HELPDESK_ATTACHMENTS . " where helpdesk_entries_id= '" . (int) $he_id . "'");
     if ($g_db->num_rows($attachments_query)) {
         while ($attachments_array = $g_db->fetch_array($attachments_query)) {
             $file = HELPDESK_ATTACHMENTS_FOLDER . $attachments_array['attachment'];
             $tmp_contents = '';
             tep_read_contents($file, $tmp_contents);
             if (!empty($tmp_contents)) {
                 $contents .= chunk_split(base64_encode($tmp_contents));
             }
         }
     }
     $tmp_array = explode("\n", $entry_array['headers']);
     for ($i = 0, $dindex = -1, $j = count($tmp_array); $i < $j; $i++) {
         if ($dindex == -1) {
             $pos = strpos($tmp_array[$i], 'Delivered-To: ');
             if ($pos !== false) {
                 $dindex = $i;
             }
         }
         $pos = strpos($tmp_array[$i], 'Received: ');
         if ($pos !== false) {
Esempio n. 28
0
 /**
  * Function for extracting images from
  * html source. This function will look
  * through the html code supplied by add_html()
  * and find any file that ends in one of the
  * extensions defined in $obj->image_types.
  * If the file exists it will read it in and
  * embed it, (not an attachment).
  *
  * Function contributed by Dan Allen
  */
 function find_html_images($images_dir)
 {
     // Build the list of image extensions
     while (list($key, ) = each($this->image_types)) {
         $extensions[] = $key;
     }
     $html_images = array();
     preg_match_all('/"([^"]+\\.(' . implode('|', $extensions) . '))"/Ui', $this->html, $images);
     for ($i = 0; $i < count($images[1]); $i++) {
         basename($images[1][$i]);
         if (is_file($images_dir . basename($images[1][$i]))) {
             $html_images[] = basename($images[1][$i]);
             $this->html = str_replace($images[1][$i], basename($images[1][$i]), $this->html);
         }
     }
     if (!empty($html_images)) {
         // If duplicate images are embedded, they may show up as attachments, so remove them.
         $html_images = array_unique($html_images);
         sort($html_images);
         for ($i = 0; $i < count($html_images); $i++) {
             $image = '';
             if (tep_read_contents($images_dir . $html_images[$i], $image)) {
                 $content_type = $this->image_types[substr($html_images[$i], strrpos($html_images[$i], '.') + 1)];
                 $this->add_html_image($image, $html_images[$i], $content_type);
             }
         }
     }
 }
Esempio n. 29
0
             for ($i = 0, $j = count($result_array['messages']); $i < $j; $i++) {
                 $messageStack->add_session($result_array['messages'][$i]);
             }
             tep_redirect(tep_href_link($g_script));
         } else {
             $files_array = $result_array['files'];
         }
         $file = 'tmp_zip_' . basename($file, '.zip') . '.sql';
         $fp = fopen(DIR_FS_BACKUP . $file, 'w');
         if (!$fp) {
             $messageStack->add_session(ERROR_CANNOT_CREATE_FILE);
             tep_redirect(tep_href_link($g_script));
         }
         for ($i = 0, $j = count($files_array); $i < $j; $i++) {
             $contents = '';
             tep_read_contents(DIR_FS_BACKUP . $files_array[$i], $contents);
             fwrite($fp, $contents);
             @unlink(DIR_FS_BACKUP . $files_array[$i]);
         }
         fclose($fp);
         $_GET['file'] = $file;
     }
     break;
 case 'restorelocalnow':
     break;
     /*
         case 'restorenow':
         case 'restorelocalnow':
           tep_set_time_limit(0);
     
           if ($action == 'restorenow') {
Esempio n. 30
0
 function get_help()
 {
     extract(tep_load('sessions'));
     $help = isset($_GET['ajax']) && !empty($_GET['ajax']) ? $_GET['ajax'] : '';
     if (empty($help)) {
         $file = $this->admin_path . 'back/help_default.html';
     } else {
         $help = tep_create_safe_string($help, '', "[^0-9a-z\\-_]");
         $file = $this->admin_path . 'back/help_' . $help . '.html';
     }
     if (!is_file($file)) {
         return false;
     }
     $contents = '';
     $result = tep_read_contents($file, $contents);
     if (!$result) {
         return false;
     }
     echo '<div>' . $contents . '</div>';
     $cSessions->close();
     return true;
 }