• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fn_get_rel_dir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fn_get_rel_dir函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_rel_dir函数的具体用法?PHP fn_get_rel_dir怎么用?PHP fn_get_rel_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fn_get_rel_dir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getDirCommerceML

 public static function getDirCommerceML()
 {
     self::$path_commerceml = fn_get_files_dir_path() . 'exim/1C_' . date('dmY') . '/';
     self::$url_commerceml = Registry::get('config.http_location') . '/' . fn_get_rel_dir(self::$path_commerceml);
     self::$url_images = Storage::instance('images')->getAbsolutePath('from_1c/');
     return array(self::$path_commerceml, self::$url_commerceml, self::$url_images);
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:7,代码来源:RusEximCommerceml.php


示例2: fn_rus_tovary_mailru_url_auto

function fn_rus_tovary_mailru_url_auto()
{
    $key = Registry::get('addons.rus_tovary_mailru.cron_key');
    $company_id = Registry::get('runtime.simple_ultimate') ? Registry::get('runtime.forced_company_id') : Registry::get('runtime.company_id');
    $url = fn_url('exim.mailru_cron_export?cron_key=' . urlencode($key) . '&switch_company_id=' . $company_id, 'A');
    $text = __('mailru_export_auto_info') . '<br/ >' . $url;
    $text = '<br/ ><br/ >' . __('mailru_export_auto_info_header') . '<br/ ><br/ >' . $text . '<br /><br/ >' . __('mailru_export_auto_info_end') . '<br /><br/ >' . __('mailru_export_auto_info_bottom');
    $file = fn_get_files_dir_path() . Registry::get('addons.rus_tovary_mailru.cron_filename');
    $url_to_file = Registry::get('config.current_location') . '/' . fn_get_rel_dir($file);
    $text .= '<br/ ><br/ >' . __('mailru_export_auto_info_file') . '<br/ >' . $file . '<br/ ><a href =' . $url_to_file . '>' . $url_to_file . '</a>';
    return $text;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:12,代码来源:func.php


示例3: getLangPacksMeta

 /**
  * Gets meta information from the PO file
  *
  * @param  string $base_path Root dir
  * @param  string $pack_file PO file name (without .po extension)
  * @param  bool   $reinstall Use this flag, if pack was alread installed before to get META information
  * @return array  List of lang pack meta information
  */
 public static function getLangPacksMeta($base_path = '', $pack_file = '', $reinstall = false, $check_installed = true)
 {
     $installed_languages = $check_installed ? self::getAll(true) : array();
     $path = empty($base_path) ? Registry::get('config.dir.lang_packs') : $base_path;
     $return = array();
     if (empty($pack_file)) {
         $po_file_list = array();
         foreach (fn_get_dir_contents($path, true, false) as $pack_directory) {
             if (is_dir($path . $pack_directory)) {
                 $po_file_list[] = $pack_directory . '/core.po';
             }
         }
     } else {
         $po_file_list = array($pack_file);
     }
     foreach ($po_file_list as $po_file_name) {
         $po_file_path = $path . $po_file_name;
         if (!file_exists($po_file_path)) {
             fn_set_notification('E', __('error'), __('incorrect_po_pack_structure', array('[pack_path]' => fn_get_rel_dir(dirname($po_file_path)))));
             continue;
         }
         $metadata = Po::getMeta($po_file_path);
         if (is_array($metadata)) {
             if (!self::isValidMeta($metadata)) {
                 fn_set_notification('E', __('error'), __('po_file_is_incorrect', array('[file]' => fn_get_rel_dir($po_file_path))));
                 continue;
             }
         } else {
             fn_set_notification('E', __('error'), $metadata);
             continue;
         }
         if (isset($installed_languages[$metadata['lang_code']]) && !$reinstall) {
             continue;
         }
         $return[] = $metadata;
     }
     if (!empty($pack_file) && !empty($return)) {
         return reset($return);
     }
     return $return;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:49,代码来源:Languages.php


示例4: fn_get_dir_contents

        }
    }
    // Get export files
    $export_files = fn_get_dir_contents(fn_get_files_dir_path(), false, true);
    $result = array();
    foreach ($export_files as $file) {
        $result[] = array('name' => $file, 'size' => filesize(fn_get_files_dir_path() . $file));
    }
    // Export languages
    foreach (fn_get_translation_languages() as $lang_code => $lang_data) {
        $export_langs[$lang_code] = $lang_data['name'];
    }
    Registry::set('navigation.dynamic.sections', $sections);
    Registry::set('navigation.dynamic.active_section', $_REQUEST['section']);
    Tygh::$app['view']->assign('export_files', $result);
    Tygh::$app['view']->assign('files_rel_dir', fn_get_rel_dir(fn_get_files_dir_path()));
    Tygh::$app['view']->assign('pattern', $patterns[$pattern_id]);
    Tygh::$app['view']->assign('layouts', $layouts);
    Tygh::$app['view']->assign('export_langs', $export_langs);
} elseif ($mode == 'import') {
    if (empty($_REQUEST['section'])) {
        $_REQUEST['section'] = 'products';
    }
    list($sections, $patterns) = fn_get_patterns($_REQUEST['section'], 'import');
    if (empty($sections) && empty($patterns) || isset($_REQUEST['section']) && empty($sections[$_REQUEST['section']])) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    $pattern_id = empty($_REQUEST['pattern_id']) ? key($patterns) : $_REQUEST['pattern_id'];
    foreach ($patterns as $p_id => $p) {
        Registry::set('navigation.tabs.' . $p_id, array('title' => $p['name'], 'href' => "exim.import?pattern_id=" . $p_id . '&section=' . $_REQUEST['section'], 'ajax' => true));
    }
开发者ID:arpad9,项目名称:bygmarket,代码行数:31,代码来源:exim.php


示例5: fn_log_event

function fn_log_event($type, $action, $data = array())
{
    $object_primary_keys = array('users' => 'user_id', 'orders' => 'order_id', 'products' => 'product_id', 'categories' => 'category_id');
    $update = false;
    $content = array();
    $actions = Registry::get('settings.Logging.log_type_' . $type);
    $cut_log = Registry::ifGet('log_cut', false);
    Registry::del('log_cut');
    $cut_data = Registry::ifGet('log_cut_data', false);
    Registry::del('log_cut_data');
    if (empty($actions) || $action && !empty($actions) && empty($actions[$action]) || !empty($cut_log)) {
        return false;
    }
    if (!empty($_SESSION['auth']['user_id'])) {
        $user_id = $_SESSION['auth']['user_id'];
    } else {
        $user_id = 0;
    }
    if ($type == 'users' && $action == 'logout' && !empty($data['user_id'])) {
        $user_id = $data['user_id'];
    }
    if ($user_id) {
        $udata = db_get_row("SELECT firstname, lastname, email FROM ?:users WHERE user_id = ?i", $user_id);
    }
    $event_type = 'N';
    // notice
    if (!empty($data['backtrace'])) {
        $_btrace = array();
        $func = '';
        foreach (array_reverse($data['backtrace']) as $v) {
            if (!empty($v['file'])) {
                $v['file'] = fn_get_rel_dir($v['file']);
            }
            if (empty($v['file'])) {
                $func = $v['function'];
                continue;
            } elseif (!empty($func)) {
                $v['function'] = $func;
                $func = '';
            }
            $_btrace[] = array('file' => !empty($v['file']) ? $v['file'] : '', 'line' => !empty($v['line']) ? $v['line'] : '', 'function' => $v['function']);
        }
        $data['backtrace'] = serialize($_btrace);
    } else {
        $data['backtrace'] = '';
    }
    if ($type == 'general') {
        if ($action == 'deprecated') {
            $content['deprecated_function'] = $data['function'];
        }
        $content['message'] = $data['message'];
    } elseif ($type == 'orders') {
        $order_status_descr = fn_get_simple_statuses(STATUSES_ORDER, true, true);
        $content = array('order' => '# ' . $data['order_id'], 'id' => $data['order_id']);
        if ($action == 'status') {
            $content['status'] = $order_status_descr[$data['status_from']] . ' -> ' . $order_status_descr[$data['status_to']];
        }
    } elseif ($type == 'products') {
        $product = db_get_field("SELECT product FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $data['product_id'], Registry::get('settings.Appearance.backend_default_language'));
        $content = array('product' => $product . ' (#' . $data['product_id'] . ')', 'id' => $data['product_id']);
        if ($action == 'low_stock') {
            // log stock - warning
            $event_type = 'W';
        }
    } elseif ($type == 'categories') {
        $category = db_get_field("SELECT category FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $data['category_id'], Registry::get('settings.Appearance.backend_default_language'));
        $content = array('category' => $category . ' (#' . $data['category_id'] . ')', 'id' => $data['category_id']);
    } elseif ($type == 'database') {
        if ($action == 'error') {
            $content = array('error' => $data['error']['message'], 'query' => $data['error']['query']);
            $event_type = 'E';
        }
    } elseif ($type == 'requests') {
        if (!empty($cut_data)) {
            $data['data'] = preg_replace("/\\<(" . implode('|', $cut_data) . ")\\>(.*?)\\<\\/(" . implode('|', $cut_data) . ")\\>/s", '<${1}>******</${1}>', $data['data']);
            $data['data'] = preg_replace("/%3C(" . implode('|', $cut_data) . ")%3E(.*?)%3C%2F(" . implode('|', $cut_data) . ")%3E/s", '%3C${1}%3E******%3C%2F${1}%3E', $data['data']);
            $data['data'] = preg_replace("/(" . implode('|', $cut_data) . ")=(.*?)(&)/s", '${1}=******${3}', $data['data']);
        }
        $content = array('url' => $data['url'], 'request' => fn_strlen($data['data']) < LOG_MAX_DATA_LENGTH && preg_match('//u', $data['data']) ? $data['data'] : '', 'response' => fn_strlen($data['response']) < LOG_MAX_DATA_LENGTH && preg_match('//u', $data['response']) ? $data['response'] : '');
    } elseif ($type == 'users') {
        if (!empty($data['time'])) {
            if (empty($_SESSION['log']['login_log_id'])) {
                return false;
            }
            $content = db_get_field('SELECT content FROM ?:logs WHERE log_id = ?i', $_SESSION['log']['login_log_id']);
            $content = unserialize($content);
            $minutes = ceil($data['time'] / 60);
            $hours = floor($minutes / 60);
            if ($hours) {
                $minutes -= $hours * 60;
            }
            if ($hours || $minutes) {
                $content['loggedin_time'] = ($hours ? $hours . ' |hours| ' : '') . ($minutes ? $minutes . ' |minutes|' : '');
            }
            if (!empty($data['timeout']) && $data['timeout']) {
                $content['timeout'] = true;
            }
            $update = $_SESSION['log']['login_log_id'];
        } else {
            if (!empty($data['user_id'])) {
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:fn.log.php


示例6: die

****************************************************************************/
use Tygh\Registry;
use Tygh\Storage;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if (Registry::get('config.demo_mode')) {
    // ElFinder should not work in demo mode
    $message = json_encode(array('error' => __('error_demo_mode')));
    exit($message);
}
include Registry::get('config.dir.root') . '/js/lib/elfinder/connectors/php/elFinder.class.php';
$opts = array('rootAlias' => __('home'), 'tmbDir' => '', 'dirSize' => false, 'fileMode' => DEFAULT_FILE_PERMISSIONS, 'dirMode' => DEFAULT_DIR_PERMISSIONS, 'uploadDeny' => Registry::get('config.forbidden_mime_types'), 'disabled' => array('mkfile', 'rename', 'paste', 'read', 'edit', 'archive', 'extract'));
$company_id = Registry::get('runtime.simple_ultimate') ? Registry::get('runtime.forced_company_id') : Registry::get('runtime.company_id');
if ($mode == 'files') {
    $files_path = fn_get_files_dir_path();
    fn_mkdir($files_path);
    $opts = array('root' => $files_path, 'URL' => Registry::get('config.current_location') . '/' . fn_get_rel_dir($files_path));
    $fm = new \elFinder($opts);
    $fm->run();
} elseif ($mode == 'images') {
    $extra_path = '';
    if (!empty($company_id)) {
        $extra_path .= 'companies/' . $company_id . '/';
    }
    fn_mkdir(Storage::instance('images')->getAbsolutePath($extra_path));
    $opts = array('root' => Storage::instance('images')->getAbsolutePath($extra_path), 'URL' => Storage::instance('images')->getUrl($extra_path));
    $fm = new elFinder($opts);
    $fm->run();
}
exit;
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:elf_connector.php


示例7: getStyleImage

 /**
  * Gets a style preview image
  * @param  string $style_id style ID
  * @return string preview image URL
  */
 public function getStyleImage($style_id)
 {
     $url = '';
     $path = $this->getStyleFile($style_id, 'png');
     if (file_exists($path)) {
         $url = Registry::get('config.current_location') . '/' . fn_get_rel_dir($path);
     }
     return $url;
 }
开发者ID:askzap,项目名称:ask-zap,代码行数:14,代码来源:Styles.php


示例8: fn_get_http_files_dir_path

/**
 * Gets HTTP path user is allowed to put files to
 * @return string files path
 */
function fn_get_http_files_dir_path()
{
    $path = fn_get_rel_dir(fn_get_files_dir_path());
    $path = Registry::get('config.http_location') . '/' . $path;
    return $path;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:10,代码来源:fn.fs.php


示例9: backupDatabase

 /**
  * Makes DB backup
  *  db_filename - string name of result pack. Will be stored in Registry::get('config.dir.database') . $db_filename;
  *  db_tables - array List of tables to be backuped
  *  db_schema - bool Backup tables schema
  *  db_data - bool Backup data from tables
  * @param array $params
  *
  * @return string Path to backuped DB sql/tgz file
  */
 public static function backupDatabase($params = array())
 {
     $default_params = array('db_tables' => array(), 'db_schema' => false, 'db_data' => false, 'db_compress' => false, 'move_progress' => true);
     $params = array_merge($default_params, $params);
     $db_filename = empty($params['db_filename']) ? 'dump_' . date('mdY') . '.sql' : fn_basename($params['db_filename']);
     if (!fn_mkdir(Registry::get('config.dir.backups'))) {
         fn_set_notification('E', __('error'), __('text_cannot_create_directory', array('[directory]' => fn_get_rel_dir(Registry::get('config.dir.backups')))));
         return false;
     }
     $dump_file = Registry::get('config.dir.backups') . $db_filename;
     if (is_file($dump_file)) {
         if (!is_writable($dump_file)) {
             fn_set_notification('E', __('error'), __('dump_file_not_writable'));
             return false;
         }
     }
     $result = db_export_to_file($dump_file, $params['db_tables'], $params['db_schema'], $params['db_data'], true, true, $params['move_progress']);
     if (!empty($params['db_compress'])) {
         fn_set_progress('echo', __('compress_dump'), false);
         $ext = $params['db_compress'] == 'tgz' ? '.tgz' : '.zip';
         $result = fn_compress_files($db_filename . $ext, $db_filename, dirname($dump_file));
         unlink($dump_file);
         $dump_file .= $ext;
     }
     if ($result) {
         return $dump_file;
     }
     return false;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:39,代码来源:DataKeeper.php


示例10: fn_exim_export_file

function fn_exim_export_file($product_id, $path)
{
    $path = fn_get_files_dir_path() . fn_normalize_path($path);
    $files = db_get_array("SELECT file_path, preview_path, pfolder.folder_id FROM ?:product_files as pfiles" . " LEFT JOIN ?:product_file_folders as pfolder ON pfolder.folder_id = pfiles.folder_id" . " WHERE pfiles.product_id = ?i", $product_id);
    if (!empty($files)) {
        // If backup path is set, check if it exists and copy files there
        if (!empty($path)) {
            if (!fn_mkdir($path)) {
                fn_set_notification('E', __('error'), __('text_cannot_create_directory', array('[directory]' => fn_get_rel_dir($path))));
                return '';
            }
        }
        $_data = array();
        foreach ($files as $file) {
            Storage::instance('downloads')->export($product_id . '/' . $file['file_path'], $path . '/' . $file['file_path']);
            if (!empty($file['preview_path'])) {
                Storage::instance('downloads')->export($product_id . '/' . $file['preview_path'], $path . '/' . $file['preview_path']);
            }
            $file_data = $file['file_path'];
            if (!empty($file['folder_id'])) {
                $file_data = $file['folder_id'] . '/' . $file_data;
            }
            if (!empty($file['preview_path'])) {
                $file_data = $file_data . '#' . $file['preview_path'];
            }
            $_data[] = $file_data;
        }
        return implode(', ', $_data);
    }
    return '';
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:products.functions.php


示例11: fn_te_get_root

/**
 * Gets section root
 * @param string $type path type: full - full path, rel - relative path from root directory, repo - repository path
 * @return string path
 */
function fn_te_get_root($type, $section = 'themes')
{
    if ($section == 'themes') {
        if (fn_allowed_for('MULTIVENDOR') || Registry::get('runtime.company_id')) {
            $extra_path = '[theme]/';
        } else {
            $extra_path = '';
        }
        if ($type == 'full') {
            $path = fn_get_theme_path('[themes]/' . $extra_path, 'C');
        } elseif ($type == 'rel') {
            $path = fn_get_theme_path('/[relative]/' . $extra_path, 'C');
        } elseif ($type == 'repo') {
            $path = fn_get_theme_path('[repo]/' . $extra_path, 'C');
        }
    } elseif ($section == 'files') {
        if ($type == 'full') {
            $path = fn_get_files_dir_path();
            if (!is_dir($path)) {
                fn_mkdir($path);
            }
        } elseif ($type == 'rel') {
            $path = '/' . fn_get_rel_dir(fn_get_files_dir_path());
        }
    } elseif ($section == 'images') {
        if ($type == 'full') {
            $path = Storage::instance('images')->getAbsolutePath('');
        } elseif ($type == 'rel') {
            $path = '/' . fn_get_rel_dir(Storage::instance('images')->getAbsolutePath(''));
        }
    }
    fn_set_hook('te_get_root', $type, $section, $path);
    return $path;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:39,代码来源:file_editor.php


示例12: getUrl

 /**
  * Gets pattern URL
  * @param  string  $style_id style ID
  * @param  boolean $root     get style root directory if set to true
  * @return string  pattern URL
  */
 public function getUrl($style_id, $root = false)
 {
     $patterns = $this->getPath($style_id);
     $url = Registry::get('config.current_location') . '/' . fn_get_rel_dir($patterns) . '/';
     if ($root == true) {
         $url = str_replace('/' . $this->getRelPath($style_id), '', $url);
     }
     return $url;
 }
开发者ID:askzap,项目名称:ultimate,代码行数:15,代码来源:Patterns.php


示例13: fn_get_dir_contents

    }
    Registry::get('view')->assign('database_size', $database_size);
    Registry::get('view')->assign('all_tables', $all_tables);
    $files = fn_get_dir_contents(Registry::get('config.dir.database'), false, true, array('.sql', '.tgz'), '', true);
    sort($files, SORT_STRING);
    $backup_files = array();
    $date_format = Registry::get('settings.Appearance.date_format') . ' ' . Registry::get('settings.Appearance.time_format');
    if (is_array($files)) {
        foreach ($files as $file) {
            $backup_files[$file]['size'] = filesize(Registry::get('config.dir.database') . $file);
            $backup_files[$file]['type'] = strpos($file, '.tgz') === false ? 'sql' : 'tgz';
            $backup_files[$file]['create'] = fn_date_format(filemtime(Registry::get('config.dir.database') . $file), $date_format);
        }
    }
    Registry::get('view')->assign('backup_files', $backup_files);
    Registry::get('view')->assign('backup_dir', fn_get_rel_dir(Registry::get('config.dir.database')));
} elseif ($mode == 'delete') {
    if (!empty($_REQUEST['backup_file'])) {
        fn_rm(Registry::get('config.dir.database') . fn_basename($_REQUEST['backup_file']));
    }
    return array(CONTROLLER_STATUS_REDIRECT, "database.manage?selected_section=restore");
}
function fn_restore_dump($files)
{
    if (empty($files)) {
        return false;
    }
    fn_set_progress('parts', sizeof($files));
    foreach ($files as $file) {
        $is_archive = false;
        $list = array($file);
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:database.php


示例14: fn_get_file_ext

            $ext = fn_get_file_ext($backup_dir . $file);
            $backup_files[$file]['size'] = filesize($backup_dir . $file);
            $backup_files[$file]['create'] = fn_date_format(filemtime($backup_dir . $file), $date_format);
            if ($ext == 'tgz') {
                $backup_files[$file]['type'] = DataKeeper::BACKUP_TYPE_UNKNOWN;
            } else {
                $backup_files[$file]['type'] = DataKeeper::getBackupType($backup_dir . $file);
            }
            $backup_files[$file]['can_be_restored'] = true;
            if ($ext == 'tgz' && !$validators->isPharDataAvailable()) {
                $backup_files[$file]['can_be_restored'] = false;
                $required_phardata = true;
            }
            if ($ext == 'zip' && !$validators->isZipArchiveAvailable()) {
                $backup_files[$file]['can_be_restored'] = false;
            }
        }
    }
    if ($required_phardata) {
        fn_set_notification('E', __('error'), __('error_class_phar_data_not_found'));
    }
    $backup_create_allowed = true;
    if (!$validators->isZipArchiveAvailable()) {
        $backup_create_allowed = false;
        fn_set_notification('E', __('error'), __('error_unable_to_create_backups'));
        fn_set_notification('E', __('error'), __('error_zip_php_extension_not_installed'));
    }
    /** @var \Tygh\SmartyEngine\Core $view */
    $view = Tygh::$app['view'];
    $view->assign('database_size', $database_size)->assign('all_tables', $all_tables)->assign('backup_create_allowed', $backup_create_allowed)->assign('backup_files', $backup_files)->assign('backup_dir', fn_get_rel_dir(Registry::get('config.dir.backups')));
}
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:datakeeper.php


示例15: installLanguagePack

 /**
  * Installs new language from PO pack
  *
  * @param string $pack_path Path to PO file
  * @param array  $params
  *  reinstall: Skip adding new language
  *  validate_lang_code:Check meta information (lang_code) with updated language data (lang_code) and forbid to update if does not match
  *  force_lang_code: Skip meta lang code and use this one in all laguage variables
  * @return int Language ID
  */
 public static function installLanguagePack($pack_path, $params = array())
 {
     $default_params = array('reinstall' => false, 'validate_lang_code' => '', 'force_lang_code' => '');
     $params = array_merge($default_params, $params);
     if (!file_exists($pack_path)) {
         fn_set_notification('E', __('error'), __('unable_to_read_resource', array('[file]' => fn_get_rel_dir($pack_path))));
         return false;
     }
     $lang_meta = self::getLangPacksMeta(dirname($pack_path) . '/', basename($pack_path), $params['reinstall']);
     if (!self::isValidMeta($lang_meta)) {
         // Failed to read meta data of new language
         fn_set_notification('E', __('error'), __('check_po_file'));
         return false;
     }
     if (!empty($params['validate_lang_code']) && $lang_meta['lang_code'] != $params['validate_lang_code']) {
         fn_set_notification('E', __('error'), __('po_meta_error_validating_lang_code'));
         return false;
     }
     $lc = false;
     if (!Registry::get('runtime.company_id')) {
         if (!$params['reinstall']) {
             $language_data = array('lang_code' => $lang_meta['lang_code'], 'name' => $lang_meta['name'], 'country_code' => $lang_meta['country_code']);
             $lc = self::update($language_data, 0);
         } else {
             $lc = true;
         }
         if ($lc !== false) {
             fn_save_languages_integrity();
             $query = array();
             $original_values_query = array();
             $iteration = 0;
             $max_vars_in_query = 500;
             if (!empty($params['force_lang_code'])) {
                 $lang_meta['lang_code'] = $params['force_lang_code'];
             }
             $lang_data = Po::getValues($pack_path, 'Languages');
             if (!is_array($lang_data)) {
                 fn_set_notification('E', __('error'), $lang_data);
                 return array();
             }
             foreach ($lang_data as $var_name => $var_data) {
                 if (!empty($var_name)) {
                     $id = $var_data['id'];
                     $value = implode('', $var_data['msgstr']);
                     $original_value = $var_data['msgid'];
                     $value = empty($value) ? $original_value : $value;
                     $query[] = db_quote('(?s, ?s, ?s)', $lang_meta['lang_code'], trim($id), trim($value));
                     $original_values_query[] = db_quote('(?s, ?s)', $var_name, trim($original_value));
                 }
                 if ($iteration > $max_vars_in_query) {
                     self::executeLangQueries('language_values', array('lang_code', 'name', 'value'), $query);
                     self::executeLangQueries('original_values', array('msgctxt', 'msgid'), $original_values_query);
                     $query = array();
                     $iteration = 0;
                 }
                 $iteration++;
             }
             self::executeLangQueries('language_values', array('lang_code', 'name', 'value'), $query);
             self::executeLangQueries('original_values', array('msgctxt', 'msgid'), $original_values_query);
             $settings_sections = Po::getValues($pack_path, 'SettingsSections');
             $query = array();
             $original_values_query = array();
             $iteration = 0;
             foreach ($settings_sections as $var_name => $var_data) {
                 if (!empty($var_name)) {
                     $value = implode('', $var_data['msgstr']);
                     $original_value = $var_data['msgid'];
                     $value = empty($value) ? $original_value : $value;
                     if (!empty($var_data['parent'])) {
                         $parent_id = db_get_field('SELECT section_id FROM ?:settings_sections WHERE name = ?s AND type = ?s', $var_data['parent'], Settings::ADDON_SECTION);
                         $section_id = db_get_field('SELECT section_id FROM ?:settings_sections WHERE name = ?s AND parent_id = ?i', $var_data['id'], $parent_id);
                     } else {
                         $section_id = db_get_field('SELECT section_id FROM ?:settings_sections WHERE name = ?s', $var_data['id']);
                     }
                     if (empty($section_id)) {
                         continue;
                     }
                     $query[] = db_quote('(?i, ?s, ?s, ?s)', $section_id, 'S', $lang_meta['lang_code'], trim($value), trim($original_value));
                     $original_values_query[] = db_quote('(?s, ?s)', trim($var_name), trim($original_value));
                 }
                 if ($iteration > $max_vars_in_query) {
                     self::executeLangQueries('settings_descriptions', array('object_id', 'object_type', 'lang_code', 'value'), $query);
                     self::executeLangQueries('original_values', array('msgctxt', 'msgid'), $original_values_query);
                     $query = array();
                     $iteration = 0;
                 }
                 $iteration++;
             }
             self::executeLangQueries('settings_descriptions', array('object_id', 'object_type', 'lang_code', 'value'), $query);
             self::executeLangQueries('original_values', array('msgctxt', 'msgid'), $original_values_query);
//.........这里部分代码省略.........
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:101,代码来源:Languages.php


示例16: substr

         $kop = substr($for_rub, -$length_for_kop);
         $total_print = '<strong>' . $rub . '</strong>&nbsp;' . __("sbrf_rub") . '&nbsp;<strong>' . $kop . '</strong>&nbsp;' . __("sbrf_kop");
     } else {
         $total_print = '<strong>' . $for_rub . '</strong>&nbsp;' . __("sbrf_rub");
     }
 } else {
     $total_print = fn_format_price_by_currency($order_info['total']);
 }
 $view = Tygh::$app['view'];
 $view->assign('total_print', $total_print);
 $view->assign('order_info', $order_info);
 $view->assign('fonts_path', fn_get_theme_path('[relative]/[theme]/media/fonts'));
 $temp_dir = Registry::get('config.dir.cache_misc') . 'tmp/';
 fn_mkdir($temp_dir);
 $path = fn_qr_generate($order_info, '|', $temp_dir);
 $url_qr_code = Registry::get('config.http_location') . '/' . fn_get_rel_dir($path);
 $view->assign('url_qr_code', $url_qr_code);
 if ($mode == "send_sbrf_receipt") {
     if (!empty($order_info['email'])) {
         fn_disable_live_editor_mode();
         $html = array($view->displayMail('addons/rus_payments/print_sbrf_receipt.tpl', false, 'C'));
         Pdf::render($html, fn_get_files_dir_path() . 'sberbank_receipt.pdf', 'save');
         $data = array('order_info' => $order_info, 'total_print' => $total_print, 'fonts_path' => fn_get_theme_path('[relative]/[theme]/media/fonts'), 'url_qr_code' => $url_qr_code, 'email_subj' => __("sbrf_receipt_for_payment", array('[order_id]' => $order_info['order_id'])));
         Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'default_company_orders_department', 'data' => $data, 'attachments' => array(fn_get_files_dir_path() . 'sberbank_receipt.pdf'), 'tpl' => 'addons/rus_payments/print_sbrf_receipt.tpl', 'is_html' => true), 'A');
         fn_set_notification('N', __('notice'), __('text_email_sent'));
     }
 } else {
     $view->assign('show_print_button', true);
     $view->displayMail('addons/rus_payments/print_sbrf_receipt.tpl', true, 'C');
 }
 exit;
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.post.php


示例17: fn_get_dir_contents

        }
    }
    // Get export files
    $export_files = fn_get_dir_contents(fn_get_files_dir_path(), false, true);
    $result = array();
    foreach ($export_files as $file) {
        $result[] = array('name' => $file, 'size' => filesize(fn_get_files_dir_path() . $file));
    }
    // Export languages
    foreach (fn_get_translation_languages() as $lang_code => $lang_data) {
        $export_langs[$lang_code] = $lang_data['name'];
    }
    Registry::set('navigation.dynamic.sections', $sections);
    Registry::set('navigation.dynamic.active_section', $_REQUEST['section']);
    Registry::get('view')->assign('export_files', $result);
    Registry::get('view')->assign('files_rel_dir', fn_get_rel_dir(fn_get_files_dir_path()));
    Registry::get('view')->assign('pattern', $patterns[$pattern_id]);
    Registry::get('view')->assign('layouts', $layouts);
    Registry::get('view')->assign('export_langs', $export_langs);
} elseif ($mode == 'import') {
    if (empty($_REQUEST['section'])) {
        $_REQUEST['section'] = 'products';
    }
    list($sections, $patterns) = fn_get_patterns($_REQUEST['section'], 'import');
    if (empty($sections) && empty($patterns) || isset($_REQUEST['section']) && empty($sections[$_REQUEST['section']])) {
        return array(CONTROLLER_STATUS_DENIED);
    }
    $pattern_id = empty($_REQUEST['pattern_id']) ? key($patterns) : $_REQUEST['pattern_id'];
    foreach ($patterns as $p_id => $p) {
        Registry::set('navigation.tabs.' . $p_id, array('title' => $p['name'], 'href' => "exim.import?pattern_id=" . $p_id . '&section=' . $_REQUEST['section'], 'ajax' => true));
    }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:exim.php


示例18: str_replace

            $view->setArea('C', '', Registry::get('runtime.company_id'));
            $updated_template_path = str_replace($view->getTemplateDir(0), '', $file_path);
            $view->clearCompiledTemplate($updated_template_path);
            $view->setArea(AREA, '', Registry::get('runtime.company_id'));
        } else {
            fn_set_notification('E', __('error'), __('cannot_write_file', array('[file]' => fn_get_rel_dir($file_path))));
        }
        exit;
    }
    if ($mode == 'upload_file') {
        $uploaded_data = fn_filter_uploaded_data('uploaded_data');
        $pname = fn_normalize_path($root_dir . $_REQUEST['path'] . '/');
        foreach ((array) $uploaded_data as $udata) {
            if (fn_te_check_path($pname)) {
                if (!fn_copy($udata['path'], $pname . $udata['name'])) {
                    fn_set_notification('E', __('error'), __('cannot_write_file', array('[file]' => fn_get_rel_dir($pname . $udata['name']))));
                }
            }
        }
        return array(CONTROLLER_STATUS_OK, "templates.manage");
    }
}
if ($mode == 'manage') {
    if (!empty($_REQUEST['selected_path'])) {
        Tygh::$app['view']->assign('selected_path', '/' . fn_te_form_path($_REQUEST['selected_path']));
    }
    Tygh::$app['view']->assign('rel_path', fn_te_get_root('rel'));
} elseif ($mode == 'init_view') {
    $dir = $_REQUEST['dir'];
    $tpath = fn_normalize_path($root_dir . $dir);
    if (fn_te_check_path($tpath) === false || !file_exists($tpath)) {
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:templates.php


示例19: fn_rus_exim_1c_get_dir_1c

function fn_rus_exim_1c_get_dir_1c()
{
    $dir_1c = fn_get_files_dir_path() . 'exim/1C_' . date('dmY') . '/';
    $dir_1c_url = Registry::get('config.http_location') . '/' . fn_get_rel_dir($dir_1c);
    $dir_1c_images = Storage::instance('images')->getAbsolutePath('from_1c/');
    return array($dir_1c, $dir_1c_url, $dir_1c_images);
}
开发者ID:askzap,项目名称:ask-zap,代码行数:7,代码来源:func.php


示例20: fn_get_dir_contents

        $database_size += $v['Data_length'] + $v['Index_length'];
        $all_tables[] = $v['Name'];
    }
    $view->assign('database_size', $database_size);
    $view->assign('all_tables', $all_tables);
    $files = fn_get_dir_contents(Registry::get('config.dir.backups'), false, true, array('.sql', '.tgz', '.zip'), '', true);
    sort($files, SORT_STRING);
    $backup_files = array();
    $date_format = Registry::get('settings.Appearance.date_format') . ' ' . Registry::get('settings.Appearance.time_format');
    if (is_array($files)) {
        $backup_dir = Registry::get('config.dir.backups');
        foreach ($files as $file) {
            $ext = fn_get_file_ext($backup_dir . $file);
            $backup_files[$file]['size'] = filesize($backup_dir . $file);
            $backup_files[$file]['create'] = fn_date_format(filemtime($backup_dir . $file), $date_format);
            if ($ext == 'sql') {
                $backup_files[$file]['type'] = 'database';
            } else {
                $backup_files[$file]['type'] = DataKeeper::getArchiveType($backup_dir . $file);
            }
        }
    }
    $supported_archive_types = array('tgz');
    $validators = new Validators();
    if ($validators->isZipArchiveAvailable()) {
        $supported_archive_types[] = 'zip';
    }
    $view->assign('supported_archive_types', $supported_archive_types);
    $view->assign('backup_files', $backup_files);
    $view->assign('backup_dir', fn_get_rel_dir(Registry::get('config.dir.backups')));
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:datakeeper.php



注:本文中的fn_get_rel_dir函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fn_get_schema函数代码示例发布时间:2022-05-15
下一篇:
PHP fn_get_profile_fields函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap