本文整理汇总了PHP中manageconfig::createfile方法的典型用法代码示例。如果您正苦于以下问题:PHP manageconfig::createfile方法的具体用法?PHP manageconfig::createfile怎么用?PHP manageconfig::createfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类manageconfig
的用法示例。
在下文中一共展示了manageconfig::createfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: head
$id = $gpc->get('id', int);
$result = $db->query("SELECT id, title FROM {$db->pre}packages WHERE id = '{$id}' LIMIT 1", __LINE__, __FILE__);
if ($db->num_rows() != 1) {
echo head();
error('javascript: self.close();', 'Specified package (' . $id . ') does not exist.');
}
$data = $db->fetch_assoc($result);
$dest = $gpc->get('language', int);
$source = $gpc->get('dir', int);
$file = 'modules.lng.php';
$phrase = $gpc->get('phrase', str);
$destpath = 'language/' . $dest . '/' . $file;
$c = new manageconfig();
if (!file_exists($destpath)) {
createParentDir($file, 'language/' . $dest);
$c->createfile($destpath, 'lang');
}
$file = substr($file, 0, strlen($file) - 8);
$langarr = return_array($file, $source);
if (!isset($langarr[$phrase])) {
error('admin.php?action=language&job=phrase_file&file=' . $file, 'Phrase not found!');
}
$c->getdata($destpath, 'lang');
$c->updateconfig($phrase, str, $langarr[$phrase]);
$c->savedata();
ok('admin.php?action=cms&job=package_language&id=' . $id);
} elseif ($job == 'package_language_edit') {
echo head();
$phrase = $gpc->get('phrase', none);
$id = $gpc->get('id', int);
$result = $db->query("SELECT id, title FROM {$db->pre}packages WHERE id = '{$id}' LIMIT 1", __LINE__, __FILE__);
示例2: foot
<td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php
echo $lang->phrase('admin_lang_create');
?>
" /></td>
</tr>
</table>
</form>
<?php
echo foot();
} elseif ($job == 'phrase_add_lngfile2') {
$dir = base64_decode($gpc->get('dir', none));
$file = $gpc->get('file', none);
$c = new manageconfig();
$result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language');
while ($row = $db->fetch_assoc($result)) {
$c->createfile("language/{$row['id']}/{$dir}{$file}.lng.php", 'lang');
}
echo head();
ok('admin.php?action=language&job=phrase_file&file=' . urlencode(base64_encode("{$dir}{$file}.lng.php")), $lang->phrase('admin_lang_langfile_created'));
} elseif ($job == 'phrase_add_mailfile') {
echo head();
$result = $db->query('SELECT * FROM ' . $db->pre . 'language ORDER BY language');
?>
<form name="form" method="post" action="admin.php?action=language&job=phrase_add_mailfile2">
<table class="border" border="0" cellspacing="0" cellpadding="4">
<tr>
<td class="obox" colspan="2"><?php
echo $lang->phrase('admin_lang_add_new_mail_file');
?>
</td>
</tr>