本文整理汇总了PHP中CORE_xml类的典型用法代码示例。如果您正苦于以下问题:PHP CORE_xml类的具体用法?PHP CORE_xml怎么用?PHP CORE_xml使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CORE_xml类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: voip_prepaid
function voip_prepaid()
{
$db =& DB();
$rs = $db->Execute(sqlSelect($db, "voip", "prepaid_low_balance", "id=::" . DEFAULT_SITE . "::"));
if ($rs && $rs->RecordCount() > 0) {
# e-mail user's once when balance reaches this amount:
$this->lowBalance = $rs->fields[0];
} else {
$this->lowBalance = false;
}
$this->pinLenth = 10;
// up to 10
# name of this module:
$this->module = "voip_prepaid";
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
示例2: get_lang_pack
function get_lang_pack($module, $language)
{
# define the language names / ids (must match the language.name & language.id fields in the DB
$this->lang_arr[0] = 'english';
# get the Core language pack
if ($module == 'CORE') {
$pack_file = PATH_LANGUAGE . 'core/' . $language . '_core.xml';
$this->language_name = $language;
} else {
if ($language != '') {
$pack_file = PATH_LANGUAGE . '' . $module . '/' . $language . '_' . $module . '.xml';
}
}
$def_pack_file = PATH_LANGUAGE . '' . $module . '/' . DEFAULT_LANGUAGE . '_' . $module . '.xml';
# check that the defined file exists, if not, use the default language instead:
if (file_exists($pack_file)) {
# open the file for parsing
$C_xml = new CORE_xml();
$this->lang_pack["{$module}"]["{$language}"] = $C_xml->xml_to_array($pack_file);
} else {
# open the default language file for parsing
$C_xml = new CORE_xml();
$this->lang_pack["{$module}"]["{$language}"] = $C_xml->xml_to_array($def_pack_file);
}
}
示例3: construct
function construct()
{
$this->table = 'asset_pool';
$this->module = 'asset_pool';
$this->xml_construct = PATH_MODULES . $this->module . "/" . $this->module . "_construct.xml";
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
示例4: import
function import()
{
# name of this module:
$this->module = "import";
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
示例5: email_template_translate
function email_template_translate()
{
# name of this module:
$this->module = "email_template_translate";
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
示例6: voip_blacklist
function voip_blacklist()
{
# name of this module:
$this->module = "voip_blacklist";
if (!defined('AJAX')) {
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
}
示例7: htaccess_dir
function htaccess_dir()
{
# name of this module:
$this->module = "htaccess_dir";
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
# add extra lines needed in the .htaccess files when added/updated:
# Example:
#$this->htaccess_extra = "Options +FollowSymlinks\n";
$this->htaccess_extra = '';
}
示例8: report_menu
/**
* Get the list of available reports
*/
function report_menu($VAR)
{
global $C_translate;
$C_xml = new CORE_xml();
if (empty($VAR['report_module'])) {
echo $C_translate->translate('no_reports', 'report', '');
return;
} else {
$module = $VAR['report_module'];
}
if (!empty($VAR['report_template'])) {
$default = $VAR['report_template'];
} else {
$default = false;
}
$return = '<select id="report_template" name="report_template" width="150" size="5" onChange="submit()" multiple>';
$path = PATH_AGILE . 'reports/' . $module . '/';
chdir($path);
$dir = opendir($path);
$count = 0;
while ($file_name = readdir($dir)) {
if ($file_name != '..' && $file_name != '.' && ereg(".xml\$", $file_name)) {
$template = $C_xml->xml_to_array($path . $file_name);
$name = $template['report']['title'];
$return .= "<option value=\"{$file_name}\"";
if ($default == $file_name) {
$return .= " selected";
}
$return .= ">{$name}</option>\n";
$count++;
}
}
if ($count == 0) {
$return .= '<option value="">' . $C_translate->translate('no_reports', 'report', '') . '</option>';
}
$return .= '</select>';
echo $return;
}
示例9: dev_install_xml_gen
function dev_install_xml_gen($module, $module_id)
{
# get the module parent
$db =& DB();
$sql = "SELECT * FROM " . AGILE_DB_PREFIX . "module WHERE\n site_id = " . $db->qstr(DEFAULT_SITE) . " AND\n id = " . $db->qstr($module_id);
$mr = $db->Execute($sql);
if ($mr->fields["parent_id"] == "" || $mr->fields["parent_id"] == "0" || $mr->fields["parent_id"] == $module_id) {
$parent = $module;
} else {
$db =& DB();
$sql = "SELECT * FROM " . AGILE_DB_PREFIX . "module WHERE\n site_id = " . $db->qstr(DEFAULT_SITE) . " AND\n id = " . $db->qstr($mr->fields["parent_id"]);
$mrp = $db->Execute($sql);
$parent = $mrp->fields["name"];
}
# get the current settings:
$t = "\t";
$n = "\n";
$C_xml = new CORE_xml();
$inst = $C_xml->xml_to_array(PATH_MODULES . '' . $module . '/' . $module . '_install.xml');
# Get any dependancy
$dependancy = @$inst['install']['module_properties']['dependancy'];
# Get any sub_modules
$sub_modules = @$inst['install']['module_properties']['sub_modules'];
#################################################################
# regenerate the install file:
$xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>{$n}";
$install_xml = "<install>" . $n . "{$t}<module_properties>" . $n . "{$t}{$t}<name>{$module}</name>" . $n . "{$t}{$t}<parent>{$parent}</parent>" . $n . "{$t}{$t}<notes><![CDATA[{$mr->fields["notes"]}]]></notes>{$n}";
if (!empty($mr->fields["menu_display"])) {
$install_xml .= "{$t}{$t}<menu_display>1</menu_display>{$n}";
}
if (!empty($dependancy)) {
$install_xml .= "{$t}{$t}<dependancy>{$dependancy}</dependancy>{$n}";
}
if (!empty($sub_modules)) {
$install_xml .= "{$t}{$t}<sub_modules>{$sub_modules}</sub_modules>{$n}";
}
$install_xml .= "{$t}</module_properties>" . $n . "{$t}<sql_inserts>" . $n . "{$t}{$t}<module_method>" . $n;
# loop through the methods
$db =& DB();
$sql = "SELECT * FROM " . AGILE_DB_PREFIX . "module_method WHERE\n site_id = " . $db->qstr(DEFAULT_SITE) . " AND\n module_id = " . $db->qstr($module_id);
$result = $db->Execute($sql);
while (!$result->EOF) {
$method = $result->fields['name'];
$display = $result->fields['menu_display'];
$notes = $result->fields['notes'];
$page = trim(ereg_replace('&', '&', $result->fields['page']));
$install_xml .= "{$t}{$t}{$t}<{$method}>" . $n . "{$t}{$t}{$t}{$t}<name>{$method}</name>" . $n;
if (!empty($notes)) {
$install_xml .= "{$t}{$t}{$t}{$t}<notes><![CDATA[{$notes}]]></notes>" . $n;
}
if (!empty($page)) {
$install_xml .= "{$t}{$t}{$t}{$t}<page><![CDATA[{$page}]]></page>" . $n;
}
if (!empty($display)) {
$install_xml .= "{$t}{$t}{$t}{$t}<menu_display>1</menu_display>" . $n;
}
$install_xml .= "{$t}{$t}{$t}</{$method}>" . $n;
$result->MoveNext();
}
$install_xml .= "{$t}{$t}</module_method>" . $n . "{$t}</sql_inserts>" . $n . "</install>";
return $install_xml;
}
示例10: upgrade
function upgrade($VAR)
{
if (!isset($VAR['module_name']) || !isset($VAR['module_group'])) {
echo "You must select both the module(s) to upgrade and the groups to grant access to new methods to.";
return;
}
$module_count = 0;
$method_count = 0;
$fields_count = 0;
$method_new_count = 0;
$fields_new_count = 0;
# loop through each module
$modules = $VAR['module_name'];
for ($i = 0; $i < count($modules); $i++) {
# increment module count
$module_count++;
# get the module details
$db =& DB();
$db_module = $db->Execute(sqlSelect($db, "module", "*", "id=::{$modules[$i]}:: or name=::{$modules[$i]}::"));
$module_name = $db_module->fields['name'];
$module_id = $db_module->fields['id'];
#########################################################################
# Update the Methods from the <module>_install.xml file
# get the install xml file
#########################################################################
$install_xml = PATH_MODULES . $module_name . '/' . $module_name . '_install.xml';
if (is_file($install_xml)) {
$C_xml = new CORE_xml();
@($methods = $C_xml->xml_to_array($install_xml));
@($methods = $methods['install']['sql_inserts']['module_method']);
# loop through the methods
if (is_array($methods)) {
while (list($key, $value) = each($methods)) {
# increment method count
$method_count++;
# see if this method exists
$sql = 'SELECT * FROM ' . AGILE_DB_PREFIX . 'module_method WHERE
name = ' . $db->qstr($key) . ' AND
module_id = ' . $db->qstr($module_id) . ' AND
site_id = ' . $db->qstr(DEFAULT_SITE);
$method_db = $db->Execute($sql);
if ($method_db === false) {
global $C_debug;
$C_debug->error('module.inc.php', 'upgrade', $db->ErrorMsg());
}
if ($method_db->RecordCount() == 0) {
# increment method count
$method_new_count++;
### add this method
@($notes = $methods[$key]["notes"]);
@($page = $methods[$key]["page"]);
@($menu_display = $methods[$key]["menu_display"]);
$method_id = sqlGenID($db, 'module_method');
$fields = array('name' => $key, 'module_id' => $module_id, 'notes' => $notes, 'page' => $page, 'menu_display' => $menu_display);
$db->Execute(sqlInsert($db, "module_method", $fields, $method_id));
if ($result === false) {
global $C_debug;
$C_debug->error('module.inc.php', 'upgrade', $db->ErrorMsg());
}
### Create the group_method records, with the ID from each
for ($ii = 0; $ii < count($VAR["module_group"]); $ii++) {
$group_method_id = $db->GenID(AGILE_DB_PREFIX . "" . 'group_method_id');
$q = 'INSERT INTO ' . AGILE_DB_PREFIX . 'group_method SET
id = ' . $db->qstr($group_method_id) . ',
site_id = ' . $db->qstr(DEFAULT_SITE) . ',
method_id = ' . $db->qstr($method_id) . ',
module_id = ' . $db->qstr($module_id) . ',
group_id = ' . $db->qstr($VAR["module_group"][$ii]);
$result = $db->Execute($q);
if ($result === false) {
global $C_debug;
$C_debug->error('module.inc.php', 'upgrade', $db->ErrorMsg());
}
}
}
}
}
}
#########################################################################
# Update the DB Fields from the <module>_construct.xml file
# get the install xml file
#########################################################################
$construct_xml = PATH_MODULES . $module_name . '/' . $module_name . '_construct.xml';
if (is_file($construct_xml)) {
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($construct_xml);
@($fields = $construct['construct']['field']);
### Check that this Module has any db installation required...
if (!empty($construct["construct"]["table"]) && $construct["construct"]["table"] == $module_name) {
### Create the module DB table
$table = $construct["construct"]["table"];
$db =& DB();
$db_fields = $db->MetaColumns(AGILE_DB_PREFIX . $table, true);
### Create the module DB fields
$arr_field = $construct["construct"]["field"];
### Loop through the fields to build the list:
while (list($key, $value) = each($arr_field)) {
$field = $key;
$FIELD = strtoupper($key);
if (!isset($db_fields[$FIELD])) {
//.........这里部分代码省略.........
示例11: construct
function construct()
{
# name of this module:
$this->module = "ticket";
# location of the construct XML file:
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
# open the construct file for parsing
if (defined('AJAX')) {
require_once PATH_CORE . 'xml.inc.php';
require_once PATH_CORE . 'translate.inc.php';
$C_translate = new CORE_translate();
global $C_translate;
}
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}
示例12: invoice_construct
function invoice_construct()
{
$this->module = "invoice";
$this->xml_construct = PATH_MODULES . "" . $this->module . "/" . $this->module . "_construct.xml";
include_once PATH_CORE . 'xml.inc.php';
$C_xml = new CORE_xml();
$construct = $C_xml->xml_to_array($this->xml_construct);
$this->method = $construct["construct"]["method"];
$this->trigger = $construct["construct"]["trigger"];
$this->field = $construct["construct"]["field"];
$this->table = $construct["construct"]["table"];
$this->module = $construct["construct"]["module"];
$this->cache = $construct["construct"]["cache"];
$this->order_by = $construct["construct"]["order_by"];
$this->limit = $construct["construct"]["limit"];
}