本文整理汇总了PHP中PerchLang::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP PerchLang::fetch方法的具体用法?PHP PerchLang::fetch怎么用?PHP PerchLang::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PerchLang
的用法示例。
在下文中一共展示了PerchLang::fetch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_lang_options
public static function get_lang_options()
{
$Lang = PerchLang::fetch();
$out = array();
// Addons folder
if (is_dir(PerchUtil::file_path(PERCH_PATH . '/addons/lang'))) {
$lang_dir = PerchUtil::file_path(PERCH_PATH . '/addons/lang');
$files = PerchUtil::get_dir_contents($lang_dir, false);
if (is_array($files)) {
foreach ($files as $file) {
$out[] = PerchUtil::strip_file_extension($file);
}
}
}
// Core folder
$lang_dir = PerchUtil::file_path(PERCH_CORE . '/lang');
if (is_dir($lang_dir)) {
$files = PerchUtil::get_dir_contents($lang_dir, false);
if (is_array($files)) {
foreach ($files as $file) {
$f = PerchUtil::strip_file_extension($file);
if (!in_array($f, $out)) {
$out[] = $f;
}
}
}
}
if (PerchUtil::count($out)) {
sort($out);
return $out;
}
return false;
}
示例2: __construct
function __construct($version = 1.0, $app_id)
{
$this->app_id = $app_id;
$this->version = $version;
if (!defined('PERCH_APPS_EDITOR_PLUGIN')) {
define('PERCH_APPS_EDITOR_PLUGIN', 'markitup');
}
if (!defined('PERCH_APPS_EDITOR_MARKUP_LANGUAGE')) {
define('PERCH_APPS_EDITOR_MARKUP_LANGUAGE', 'textile');
}
if (strpos($app_id, '_') === false) {
$this->Lang = PerchLang::fetch();
}
}
示例3: array
$postvars = array('headerColour', 'headerScheme', 'lang', 'hideBranding', 'helpURL', 'siteURL', 'dashboard', 'hide_pwd_reset');
$checkboxes = array('hideBranding', 'dashboard', 'hide_pwd_reset');
include '_app_settings.pre.php';
$data = $Form->receive($postvars);
foreach ($checkboxes as $checkbox) {
if (!isset($data[$checkbox])) {
$data[$checkbox] = '0';
}
}
if (isset($_POST['logo_remove']) && $_POST['logo_remove'] == '1') {
$data['logoPath'] = '';
}
foreach ($data as $key => $value) {
$Settings->set($key, $value);
}
$Lang = PerchLang::fetch();
$Lang->reload();
$Alert->set('success', PerchLang::get("Your settings have been updated."));
// image upload
if (isset($_FILES['customlogo']) && (int) $_FILES['customlogo']['size'] > 0) {
if (is_array(getimagesize($_FILES['customlogo']['tmp_name']))) {
$filename = $_FILES['customlogo']['name'];
if (strpos($filename, '.php') !== false) {
$filename .= '.txt';
}
// diffuse PHP files
$target = PERCH_RESFILEPATH . '/' . $filename;
if (file_exists($target)) {
$filename = time() . '_' . $_FILES['customlogo']['name'];
$target = PERCH_RESFILEPATH . '/' . $filename;
}