本文整理汇总了PHP中loader_import函数的典型用法代码示例。如果您正苦于以下问题:PHP loader_import函数的具体用法?PHP loader_import怎么用?PHP loader_import使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loader_import函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getQueue
function getQueue($type = false)
{
if (!$type) {
$type = $this->name;
}
loader_import('cms.Workspace.Notice.' . $this->types[$type]);
$res = db_fetch('select * from sitellite_msg_queue where type = ?', $type);
if (!$res) {
$this->error = db_error();
return false;
} elseif (is_object($res)) {
$res = array($res);
}
foreach ($res as $k => $v) {
$qid = $res[$k]->id;
$struct = $res[$k]->struct;
$res[$k] = unserialize($struct);
if (!$res[$k]) {
$this->error = 'unserialize() failed: ' . $struct;
return false;
}
$res[$k]->qid = $qid;
}
return $res;
}
示例2: onSubmit
function onSubmit($vals)
{
// 1. prepare vals for insertion
if ($vals['contact_url'] == 'http://') {
$vals['contact_url'] = '';
}
if ($vals['loc_map'] == 'http://') {
$vals['loc_map'] = '';
}
$vals['details'] = nl2br(wordwrap(htmlentities_compat($vals['details']), 70, "\n", true));
if (!$vals['public'] || empty($vals['public'])) {
$vals['public'] = 'no';
}
if (!$vals['media'] || empty($vals['media'])) {
$vals['media'] = 'no';
}
if (!empty($vals['loc_addr2'])) {
$vals['loc_address'] .= "\n" . $vals['loc_addr2'];
}
$data = array('title' => $vals['title'], 'date' => $vals['date'], 'until_date' => $vals['end_date'], 'time' => $vals['time'], 'until_time' => $vals['end_time'], 'category' => $vals['category'], 'audience' => $vals['audience'], 'details' => $vals['details'], 'contact' => $vals['contact'], 'contact_email' => $vals['contact_email'], 'contact_phone' => $vals['contact_phone'], 'contact_url' => $vals['contact_url'], 'loc_name' => $vals['loc_name'], 'loc_address' => $vals['loc_address'], 'loc_city' => $vals['loc_city'], 'loc_province' => $vals['loc_province'], 'loc_country' => $vals['loc_country'], 'sponsor' => $vals['sponsor'], 'rsvp' => $vals['rsvp'], 'public' => $vals['public'], 'media' => $vals['media'], 'sitellite_status' => 'draft', 'sitellite_access' => 'public');
if (session_valid()) {
$data['sitellite_owner'] = session_username();
$data['sitellite_team'] = session_team();
}
// 2. submit event as 'draft'
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteevent_event');
$res = $rex->create($data, 'Event submission.');
$vals['id'] = $res;
// 3. email notification
@mail(appconf('submissions'), 'Event Submission Notice', template_simple('submission_email.spt', $vals));
// 4. thank you screen
page_title(intl_get('Thank You!'));
echo template_simple('submissions.spt');
}
示例3: onSubmit
function onSubmit($vals)
{
unset($vals['submit_button']);
loader_import('saf.File');
file_overwrite('inc/app/sitewiki/conf/settings.php', ini_write($vals));
echo '<p>Settings saved. <a href="' . site_prefix() . '/index/sitewiki-app">Continue</a></p>';
}
示例4: getThemes
function getThemes($path = false)
{
if (!$path) {
$path = site_docroot() . '/inc/app/sitepresenter/themes';
}
$themes = array();
//'' => 'Default');
loader_import('saf.File.Directory');
$dir = new Dir();
if (!$dir->open($path)) {
return $themes;
}
foreach ($dir->read_all() as $file) {
if (strpos($file, '.') === 0 || !@is_dir($path . '/' . $file)) {
continue;
}
//if (preg_match ('/^html.([^\.]+)\.tpl$/', $file, $regs)) {
//if ($regs[1] == 'default') {
// continue;
//}
$themes[$file] = ucfirst($file);
//}
}
return $themes;
}
示例5: getTemplates
function getTemplates($path = false)
{
if (!$path) {
$path = 'inc/html/' . conf('Server', 'default_template_set');
}
$templates = array('' => 'Inherit', 'default' => 'Default');
loader_import('saf.File.Directory');
$dir = new Dir();
if (!$dir->open($path)) {
return $templates;
}
foreach ($dir->read_all() as $file) {
if (strpos($file, '.') === 0 || @is_dir($path . '/' . $file)) {
continue;
}
if (preg_match('/^html.([^\\.]+)\\.tpl$/', $file, $regs)) {
if ($regs[1] == 'default') {
continue;
}
$templates[$regs[1]] = ucfirst($regs[1]);
}
}
asort($templates);
return $templates;
}
示例6: onSubmit
function onSubmit($vals)
{
loader_import('saf.File');
if (!preg_match('/\\.html$/', $vals['filename'])) {
$vals['filename'] .= '.html';
}
if (!preg_match('/\\.html$/', $vals['helpfile'])) {
$vals['helpfile'] .= '.html';
}
$vals['body'] = '<h1>' . $vals['title'] . '</h1>' . NEWLINEx2 . $vals['body'];
if (!file_overwrite(site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/' . $vals['lang'] . '/' . $vals['filename'], $vals['body'])) {
echo '<p>Error: Unable to write to the file. Please verify your file and folder permissions.</p>';
return;
}
if ($vals['helpfile'] != $vals['filename']) {
// erase old file, this is a rename
$res = @unlink(site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/' . $vals['lang'] . '/' . $vals['helpfile']);
if (!$res) {
echo '<p>Error: Unable to remove the old file. Please verify your file and folder permissions.</p>';
return;
}
}
header('Location: ' . site_prefix() . '/index/appdoc-helpdoc-action?appname=' . $vals['appname'] . '&lang=' . $vals['lang']);
exit;
}
示例7: the_cleaners
function the_cleaners($data, $wrap = true, $safe = true)
{
global $TIDY_PATH;
if ($TIDY_PATH) {
ob_start();
passthru($TIDY_PATH . " -asxhtml -icq -f /dev/null 2>&1 <<END-XED-INPUT\n" . $data . "\nEND-XED-INPUT");
$data = ob_get_contents();
ob_end_clean();
if ($wrap) {
$data = the_cleaners_strip_tidy_output($data);
}
return $data;
} else {
if ($wrap) {
$data = the_cleaners_wrapper($data);
}
loader_import('saf.HTML.Messy');
$messy = new Messy();
$messy->safe = $safe;
$data = $messy->clean($data);
if ($wrap) {
$data = the_cleaners_remove_wrapper($data);
}
return $data;
}
}
示例8: onSubmit
function onSubmit($vals)
{
loader_import('saf.File');
loader_import('saf.File.Directory');
loader_import('saf.Misc.Ini');
$info = help_get_langs($vals['appname']);
$info[$vals['lang_code']] = $vals['lang_name'];
if (!@mkdir(site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/' . $vals['lang_code'], 0777)) {
echo '<p>Error: Unable to create language folder. Please verify your folder permissions.</p>';
return;
}
if (!file_overwrite(site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/languages.php', ini_write($info))) {
echo '<p>Error: Unable to write to the file. Please verify your folder permissions.</p>';
return;
}
if (!empty($vals['copy_from'])) {
// copy help files from specified lang to new dir
$pages = help_get_pages($vals['appname'], $vals['lang']);
foreach ($pages as $page) {
$id = help_get_id($page);
$res = copy(site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/' . $vals['lang'] . '/' . $id . '.html', site_docroot() . '/inc/app/' . $vals['appname'] . '/docs/' . $vals['lang_code'] . '/' . $id . '.html');
if (!$res) {
echo '<p>Error: Unable to duplicate help files. Please verify your folder permissions.</p>';
return;
}
}
}
// go to new language
header('Location: ' . site_prefix() . '/index/appdoc-helpdoc-action?appname=' . $vals['appname'] . '&lang=' . $vals['lang_code']);
exit;
}
示例9: onSubmit
function onSubmit($vals)
{
global $cgi;
if ($vals['submit_buttons'] == 'Cancel') {
header('Location: ' . $vals['refer']);
exit;
}
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$id = $cgi->_key;
$subject = $vals['subject'];
$author = $vals['author'];
$status = $vals['status'] == 1 ? 'not visible' : 'visible';
if (empty($vals['category'])) {
$vals['category'] = $vals['oldcat'];
}
$category = $vals['category'];
$body = $vals['body'];
$data = array('subject' => $subject, 'author' => $author, 'status' => $status, 'category' => $category, 'body' => $body);
if (!empty($id)) {
$method = $rex->determineAction($id);
$rex->{$method}($id, $data);
} else {
$data['created'] = date('Y-m-d H:i:s');
$id = $rex->create($data);
}
//view post
header('Location: ' . site_prefix() . '/index/siteblog-view-action?id=' . $id);
exit;
}
示例10: onSubmit
function onSubmit($vals)
{
global $cgi;
if ($vals['submit_buttons'] == 'Cancel') {
header('Location: ' . $vals['refer']);
exit;
}
loader_import('cms.Versioning.Rex');
$rex = new Rex('siteblog_post');
$id = $cgi->_key;
$subject = $vals['subject'];
$author = $vals['author'];
$status = $vals['status'];
$category = $vals['category'];
$created = $vals['created'];
$body = $vals['body'];
$data = array('subject' => $subject, 'author' => $author, 'status' => $status, 'category' => $category, 'created' => $created, 'body' => $body);
if (!empty($id)) {
if (!$data['created']) {
unset($data['created']);
}
$method = $rex->determineAction($id);
$rex->{$method}($id, $data);
} else {
if (!$data['created']) {
$data['created'] = date('Y-m-d H:i:s');
}
$id = $rex->create($data);
}
session_set('sitellite_alert', intl_get('Your item has been saved.'));
// view post
if (!empty($vals['_return'])) {
header('Location: ' . $vals['_return']);
} else {
header('Location: ' . site_prefix() . '/index/siteblog-post-action/id.' . $id . '/title.' . siteblog_filter_link_title($subject));
}
// ping blog directories via pingomatic.com
$host = 'rpc.pingomatic.com';
$path = '';
$out = template_simple('ping.spt', $obj);
$len = strlen($out);
$req = 'POST /' . $path . " HTTP/1.0\r\n";
$req .= 'User-Agent: Sitellite ' . SITELLITE_VERSION . "/SiteBlog\r\n";
$req .= 'Host: ' . $host . "\r\n";
$req .= "Content-Type: text/xml\r\n";
$req .= 'Content-Length: ' . $len . "\r\n\r\n";
$req .= $out . "\r\n";
if ($ph = @fsockopen($host, 80)) {
@fputs($ph, $req);
//echo '<pre>';
//echo htmlentities ($req);
while (!@feof($ph)) {
$res = @fgets($ph, 128);
//echo htmlentities ($res);
}
@fclose($ph);
}
exit;
}
示例11: onSubmit
function onSubmit($vals)
{
loader_import('cms.Workspace.Message');
$msg = new WorkspaceMessage();
$msg->renameCategory($vals['name'], $vals['category']);
header('Location: ' . site_prefix() . '/index/cms-messages-action');
exit;
}
示例12: onSubmit
function onSubmit($vals)
{
loader_import('siteforum.Topic');
$t = new SiteForum_Topic();
$t->add(array('name' => $vals['name'], 'description' => $vals['description'], 'sitellite_access' => $vals['sitellite_access'], 'sitellite_status' => $vals['sitellite_status']));
header('Location: ' . site_prefix() . '/index/siteforum-app');
exit;
}
示例13: loader_import
function &siteevent_translate(&$obj)
{
loader_import('saf.Database.Generic');
$g = new Generic('siteevent_event', 'id');
$g->multilingual = true;
$res =& $g->translate($obj);
return $res;
}
示例14: siteforum_filter_shortdate
function siteforum_filter_shortdate($date)
{
if (!$date) {
return '';
}
loader_import('saf.Date');
return Date::timestamp($date, 'M j - g:i A');
}
示例15: onSubmit
function onSubmit($vals)
{
loader_import('news.Comment');
$c = new NewsComment();
$vals['ts'] = date('Y-m-d H:i:s');
unset($vals['submit_button']);
$c->modify($vals['id'], $vals);
page_title(intl_get('Comment Updated'));
echo template_simple('comment_updated.spt', $vals);
}