本文整理汇总了PHP中pathos_core_makeLocation函数的典型用法代码示例。如果您正苦于以下问题:PHP pathos_core_makeLocation函数的具体用法?PHP pathos_core_makeLocation怎么用?PHP pathos_core_makeLocation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pathos_core_makeLocation函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
function update($values, $object, $loc)
{
global $db;
if (!isset($values['id'])) {
// Only deal with the inc/dec stuff if adding a module.
$src = "";
if (isset($values['i_src'])) {
if ($values['i_src'] == "new_source") {
$src = "@random" . uniqid("");
$object->is_existing = 0;
} else {
$src = $values[$values['i_src']];
$object->is_existing = 1;
}
} else {
$object->is_existing = 0;
}
$newInternal = pathos_core_makeLocation($values['i_mod'], $src);
// REFERENCES - Section and Location
//$sect = $db->selectObject('section','id='.$_POST['current_section']);
pathos_core_incrementLocationReference($newInternal, $_POST['current_section']);
// Rank is only updateable from the order action
$object->rank = $values['rank'];
if (isset($values['rerank'])) {
$db->increment("container", "rank", 1, "external='" . serialize($loc) . "' AND rank >= " . $values['rank']);
}
$object->internal = serialize($newInternal);
$object->external = serialize($loc);
}
$object->is_private = isset($_POST['is_private']) ? 1 : 0;
// UPDATE the container
$object->view = $values['view'];
$object->title = $values['title'];
return $object;
}
示例2: show
function show($view, $loc = null, $title = "")
{
global $db;
if (!defined("SYS_USERS")) {
require_once BASE . "subsystems/users.php";
}
$boards = $db->selectObjects("bb_board", "location_data='" . serialize($loc) . "'");
$iloc = pathos_core_makeLocation($loc->mod, $loc->src);
for ($i = 0; $i < count($boards); $i++) {
$iloc->int = "b" . $boards[$i]->id;
$boards[$i]->permissions = array("edit_board" => pathos_permissions_check("edit_board", $iloc), "delete_board" => pathos_permissions_check("delete_board", $iloc));
if ($boards[$i]->last_post_id != 0) {
$lp = $db->selectObject("bb_post", "id=" . $boards[$i]->last_post_id);
$lp->poster = pathos_users_getUserById($lp->poster);
$boards[$i]->last_post = $lp;
} else {
$boards[$i]->last_post = null;
}
}
$template = new template("bbmodule", $view, $loc);
$template->assign("moduletitle", $title);
$template->assign("boards", $boards);
$template->register_permissions(array("administrate", "configure", "create_board", "edit_board", "delete_board"), $loc);
$template->output();
}
示例3: exit
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: gmgr_savemembers.php,v 1.7 2005/02/19 00:32:28 filetreefrog Exp $
##################################################
// Part of the User Management category
if (!defined('PATHOS')) {
exit('');
}
$memb = $db->selectObject('groupmembership', 'member_id=' . $user->id . ' AND group_id=' . $_GET['id'] . ' AND is_admin=1');
if (pathos_permissions_check('user_management', pathos_core_makeLocation('administrationmodule')) || $memb) {
$group = $db->selectObject('group', 'id=' . $_POST['id']);
if ($group) {
$db->delete('groupmembership', 'group_id=' . $group->id);
$memb = null;
$memb->group_id = $group->id;
if ($_POST['membdata'] != "") {
foreach (explode(',', $_POST['membdata']) as $str) {
$str = explode(':', $str);
$memb->member_id = $str[0];
$memb->is_admin = $str[1];
$db->insertObject($memb, 'groupmembership');
}
}
pathos_permissions_triggerRefresh();
pathos_flow_redirect();
示例4: exit
# PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: orphanedcontent_delete.php,v 1.7 2005/02/19 00:32:28 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
exit('');
}
// Part of the Database category
if (pathos_permissions_check('database', pathos_core_makeLocation('administrationmodule'))) {
$src = urldecode($_GET['delsrc']);
$mod = new $_GET['mod']();
if ($mod->hasContent()) {
// may not need the check, but it doesn't hurt
$mod->deleteIn(pathos_core_makeLocation($_GET['mod'], $_GET['delsrc']));
}
$db->delete('locationref', "module='" . $_GET['mod'] . "' AND source='{$src}' AND refcount=0");
$db->delete('sectionref', "module='" . $_GET['mod'] . "' AND source='{$src}' AND refcount=0");
pathos_flow_redirect();
} else {
echo SITE_403_HTML;
}
示例5: pathos_flow_set
}
if (pathos_permissions_check('database', pathos_core_makeLocation('administrationmodule'))) {
pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
$nullrefs = $db->selectObjects('locationref', 'refcount=0');
$mods = array();
$have_bad_orphans = false;
foreach ($nullrefs as $nullref) {
$modclass = $nullref->module;
$have_bad_orphans = false;
if (!isset($mods[$nullref->module])) {
if (class_exists($modclass)) {
$mod = new $modclass();
$mods[$nullref->module] = array('name' => $mod->name(), 'modules' => array());
} else {
$have_bad_orphans = true;
}
}
if (class_exists($modclass)) {
ob_start();
call_user_func(array($modclass, 'show'), DEFAULT_VIEW, pathos_core_makeLocation($modclass, $nullref->source));
$mods[$nullref->module]['modules'][$nullref->source] = ob_get_contents();
ob_end_clean();
}
}
$template = new template('administrationmodule', '_orphanedcontent');
$template->assign('modules', $mods);
$template->assign('have_bad_orphans', $have_bad_orphans);
$template->output();
} else {
echo SITE_403_HTML;
}
示例6: exit
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: manage.php,v 1.9 2005/04/18 15:22:30 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
exit("");
}
$mloc = pathos_core_makeLocation($_GET['orig_module'], $loc->src, $loc->int);
if (pathos_permissions_check('manage_categories', $mloc)) {
pathos_flow_set(SYS_FLOW_PROTECTED, SYS_FLOW_ACTION);
$categories = $db->selectObjects("category", "location_data='" . serialize($mloc) . "'");
if (pathos_template_getModuleViewFile($mloc->mod, "_cat_manageCategories", false) == TEMPLATE_FALLBACK_VIEW) {
$template = new template("categories", "_cat_manageCategories", $loc);
} else {
$template = new template($mloc->mod, "_cat_manageCategories", $loc);
}
if (!defined('SYS_SORTING')) {
require_once BASE . 'subsystems/sorting.php';
}
usort($categories, "pathos_sorting_byRankAscending");
$template->assign("origmodule", $_GET['orig_module']);
$template->assign("categories", $categories);
$template->output();
示例7: exit
# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: delete.php,v 1.5 2005/02/19 00:32:29 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
exit('');
}
$item = $db->selectObject('file', 'id=' . $_GET['id']);
if ($item) {
$loc = unserialize($item->location_data);
$iloc = pathos_core_makeLocation($loc->mod, $loc->src, $item->id);
if (pathos_permissions_check('delete', $loc) || pathos_permissions_check('delete', $iloc)) {
$db->delete('file', 'id=' . $item->id);
unlink(BASE . "files/" . $item->filename);
pathos_template_clear();
pathos_flow_redirect();
} else {
echo SITE_403_HTML;
}
} else {
echo SITE_404_HTML;
}
示例8: exit
# without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: page.php,v 1.5 2005/02/19 00:32:31 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
exit('');
}
if (pathos_permissions_check('database', pathos_core_makeLocation('administrationmodule'))) {
$page = isset($_REQUEST['page']) ? $_REQUEST['page'] : "start";
$exporter = isset($_REQUEST['exporter']) ? $_REQUEST['exporter'] : "";
$file = BASE . "modules/exporter/exporters/{$exporter}/{$page}.php";
if ($exporter != "" && is_readable($file) && is_file($file)) {
include $file;
} else {
echo SITE_404_HTML;
}
} else {
echo SITE_403_HTML;
}
示例9: exit
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: save.php,v 1.4 2005/02/19 00:32:27 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
exit("");
}
$contact = null;
$iloc = null;
if (isset($_POST['id'])) {
$contact = $db->selectObject("addressbook_contact", "id=" . $_POST['id']);
$loc = unserialize($contact->location_data);
$iloc = pathos_core_makeLocation($loc->mod, $loc->src, $contact->id);
}
if ($contact == null && pathos_permissions_check("post", $loc) || $contact != null && pathos_permissions_check("edit", $loc) || $iloc != null && pathos_permissions_check("edit", $iloc)) {
$contact = addressbook_contact::update($_POST, $contact);
$contact->location_data = serialize($loc);
if (isset($contact->id)) {
$db->updateObject($contact, "addressbook_contact");
} else {
$db->insertObject($contact, "addressbook_contact");
}
pathos_flow_redirect();
} else {
echo SITE_403_HTML;
}
示例10: pathos_core_makeLocation
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: upload_standalone.php,v 1.1 2005/05/04 19:11:32 filetreefrog Exp $
##################################################
include_once '../../../pathos.php';
$collection = null;
if (isset($_POST['collection_id'])) {
$collection = $db->selectObject('file_collection', 'id=' . $_POST['collection_id']);
} else {
$collection->id = 0;
$collection->name = 'Uncategorized Files';
$collection->description = 'Theses files have not been categorized yet,';
}
$loc = pathos_core_makeLocation('filemanagermodule');
// PERM CHECK
$file = file::update('file', 'files', null);
if (is_object($file)) {
$file->name = $_POST['name'];
$file->collection_id = $collection->id;
$file_id = $db->insertObject($file, 'file');
header('Location: ' . URL_FULL . 'modules/filemanagermodule/actions/picker.php?id=' . $collection->id . '&highlight_file=' . $file_id);
} else {
echo $file;
}
// END PERM CHECK
示例11: form
function form($object)
{
pathos_lang_loadDictionary('modules', 'inboxmodule');
pathos_lang_loadDictionary('standard', 'core');
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = new form();
$users = array();
$groups = array();
global $db, $user;
if (!defined('SYS_USERS')) {
require_once BASE . 'subsystems/users.php';
}
if (pathos_permissions_check('contact_all', pathos_core_makeLocation('inboxmodule'))) {
foreach (pathos_users_getAllUsers() as $u) {
$users[$u->id] = $u->firstname . ' ' . $u->lastname . ' (' . $u->username . ')';
}
} else {
foreach (pathos_users_getGroupsForUser($user, 1, 0) as $g) {
foreach (pathos_users_getUsersInGroup($g) as $u) {
$users[$u->id] = $u->firstname . ' ' . $u->lastname . ' (' . $u->username . ')';
}
}
}
// Process other uses who the current user has blocked, and remove them from the list
// Process other users who have blocked the current user, and remove them from the list.
foreach ($db->selectObjects('inbox_contactbanned', 'owner=' . $user->id . ' OR user_id=' . $user->id) as $blocked) {
if ($blocked->user_id == $user->id) {
// Blocked by someone else. Remove the owner (user who blocked us)
unset($users[$blocked->owner]);
} else {
if ($blocked->owner == $user->id) {
// We blocked the user, remove the blocked user_id
unset($users[$blocked->user_id]);
}
}
}
uasort($users, 'strnatcmp');
$groups = array();
foreach ($db->selectObjects('inbox_contactlist', 'owner=' . $user->id) as $g) {
$groups['list_' . $g->id] = $g->name . ' ' . TR_INBOXMODULE_PERSONALLIST;
}
if (pathos_permissions_check('contact_all', pathos_core_makeLocation('inboxmodule'))) {
foreach (pathos_users_getAllGroups(1, 0) as $g) {
$groups['group_' . $g->id] = $g->name . ' ' . TR_INBOXMODULE_SYSGROUP;
}
} else {
foreach (pathos_users_getGroupsForUser($user, 1, 0) as $g) {
$groups['group_' . $g->id] = $g->name . ' ' . TR_INBOXMODULE_SYSGROUP;
}
}
uasort($groups, 'strnatcmp');
$recipient_caption = TR_INBOXMODULE_RECIPIENT;
$group_recipient_caption = TR_INBOXMODULE_GROUPRECIPIENT;
$btn = new buttongroupcontrol(TR_INBOXMODULE_SEND, '', TR_CORE_CANCEL);
$object->group_recipient = array();
if ($object == null || !isset($object->recipient)) {
$object->subject = '';
$object->body = '';
$object->recipient = array();
if (!count($users) && !count($groups)) {
$btn->disabled = true;
}
} else {
if (!defined('SYS_USERS')) {
require_once BASE . 'subsystems/users.php';
}
$u = pathos_users_getUserById($object->recipient);
$form->register(null, '', new htmlcontrol(sprintf(TR_INBOXMODULE_REPLYTO, $u->firstname . ' ' . $u->lastname . ' (' . $u->username . ')')));
$form->meta('replyto', $object->recipient);
$object->recipient = array();
unset($users[$u->id]);
$recipient_caption = TR_INBOXMODULE_COPYTO;
$group_recipient_caption = TR_INBOXMODULE_GROUPCOPYTO;
}
if (count($users)) {
$form->register('recipients', $recipient_caption, new listbuildercontrol($object->recipient, $users));
}
if (count($groups)) {
$form->register('group_recipients', $group_recipient_caption, new listbuildercontrol($object->group_recipient, $groups));
}
if (!count($groups) && !count($users)) {
$form->register(null, '', new htmlcontrol('<div class="error">' . TR_INBOXMODULE_NOCONTACTSWARNING . '</div>'));
}
$form->register('subject', TR_INBOXMODULE_SUBJECT, new textcontrol($object->subject));
$form->register('body', TR_INBOXMODULE_MESSAGE, new htmleditorcontrol($object->body));
$form->register('submit', '', $btn);
return $form;
}
示例12: exit
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: finish_install_extension.php,v 1.7 2005/04/18 15:33:33 filetreefrog Exp $
##################################################
// Part of the Extensions category
if (!defined('PATHOS')) {
exit('');
}
if (pathos_permissions_check('extensions', pathos_core_makeLocation('administrationmodule'))) {
$template = new template('administrationmodule', '_upload_finalSummary', $loc);
$sessid = session_id();
if (!file_exists(BASE . "extensionuploads/{$sessid}") || !is_dir(BASE . "extensionuploads/{$sessid}")) {
$template->assign('nofiles', 1);
} else {
if (!defined('SYS_FILES')) {
require_once BASE . 'subsystems/files.php';
}
$success = array();
foreach (array_keys(pathos_files_listFlat(BASE . "extensionuploads/{$sessid}", true, null, array(), BASE . "extensionuploads/{$sessid}")) as $file) {
if ($file != '/archive.tar' && $file != '/archive.tar.gz' && $file != 'archive.tar.bz2' && $file != '/archive.zip') {
pathos_files_makeDirectory(dirname($file));
$success[$file] = copy(BASE . "extensionuploads/{$sessid}" . $file, BASE . substr($file, 1));
if (basename($file) == 'views_c') {
chmod(BASE . substr($file, 1), 0777);
示例13: exit
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: htmlarea_saveconfig.php,v 1.5 2005/02/19 00:32:28 filetreefrog Exp $
##################################################
// Part of the HTMLArea category
if (!defined('PATHOS')) {
exit('');
}
if (pathos_permissions_check('htmlarea', pathos_core_makeLocation('administrationmodule'))) {
$config = null;
if (isset($_POST['id'])) {
$config = $db->selectObject('htmlareatoolbar', 'id=' . $_POST['id']);
}
$config->name = $_POST['config_name'];
$config->data = array();
foreach (explode(':', $_POST['config']) as $line) {
$line = trim($line);
if ($line != '') {
$i = count($config->data);
$config->data[] = array();
foreach (explode(';', $line) as $icon) {
$config->data[$i][] = $icon;
// MAY need to strip off ed
}
示例14: exit
# You should have received a copy of the GNU
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
#
# $Id: admin_editmimetype.php,v 1.7 2005/04/18 15:49:02 filetreefrog Exp $
##################################################
// Part of the Administration Control Panel : Files Subsystem category
if (!defined('PATHOS')) {
exit('');
}
if (pathos_permissions_check('files_subsystem', pathos_core_makeLocation('administrationmodule'))) {
$type = null;
if (isset($_GET['type'])) {
$type = $db->selectObject('mimetype', "mimetype='" . $_GET['type'] . "'");
}
if (!defined('SYS_FORMS')) {
require_once BASE . 'subsystems/forms.php';
}
pathos_forms_initialize();
$form = mimetype::form($type);
$form->meta('module', 'filemanager');
$form->meta('action', 'admin_savemimetype');
$template = new template('filemanager', '_form_editmimetype', $loc);
$template->assign('form_html', $form->toHTML());
$template->assign('is_edit', isset($type->id) ? 1 : 0);
$template->output();