當前位置: 首頁>>代碼示例>>PHP>>正文


PHP manageconfig::createfile方法代碼示例

本文整理匯總了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__);
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:cms.php

示例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>
開發者ID:BackupTheBerlios,項目名稱:viscacha-svn,代碼行數:31,代碼來源:language.php


注:本文中的manageconfig::createfile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。