Exemplo n.º 1
0
function sitefaq_virtual_add_faq(&$obj)
{
    return template_simple('<a href="{site/prefix}/index/cms-add-form?collection=sitefaq_question&question={filter urlencode}{question}&answer={answer}{end filter}">
			<img src="{site/prefix}/inc/app/sitefaq/pix/add.gif" border="0"
				alt="{intl Add to live FAQs}"
				title="{intl Add to live FAQs}" /></a>', $obj);
}
Exemplo n.º 2
0
 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');
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 function onSubmit($vals)
 {
     $i = $vals['ifname'];
     unset($vals['ifname']);
     unset($vals['submit_button']);
     echo template_simple('link_return.spt', array('ifname' => $i, 'vals' => $vals));
     exit;
 }
Exemplo n.º 5
0
function sitepresenter_virtual_run($row)
{
    return template_simple('<a href="{site/prefix}/index/sitepresenter-presentation-action?id={id}" target="_blank"><img
			src="{site/prefix}/inc/app/sitepresenter/pix/run.gif" alt="{intl Run}" title="{intl Run}" border="0" /></a>
		
		<a href="{site/prefix}/index/sitepresenter-slides-action?id={id}"><img
			src="{site/prefix}/inc/app/sitepresenter/pix/slides.gif" alt="{intl Edit Slides}" title="{intl Edit Slides}" border="0" /></a>', $row);
}
Exemplo n.º 6
0
/**
 * Shows a notice (e.g., "Item deleted.") if one is set.
 */
function cms_alert()
{
    if (!cms_is_alert()) {
        return '';
    }
    $notice = session_get('sitellite_alert');
    session_set('sitellite_alert', null);
    return template_simple('alert.spt', array('msg' => $notice));
}
Exemplo n.º 7
0
 function onSubmit($vals)
 {
     session_set('xed_source_find', $vals['find']);
     session_set('xed_source_replace', $vals['replace']);
     $vals['find'] = str_replace(array('\\', '\''), array('\\\\', '\\\''), $vals['find']);
     $vals['replace'] = str_replace(array('\\', '\''), array('\\\\', '\\\''), $vals['replace']);
     echo template_simple('replace_return.spt', $vals);
     exit;
 }
Exemplo n.º 8
0
 function onSubmit($vals)
 {
     $i = $vals['ifname'];
     $html = str_replace(array("'", "\r", "\n"), array('\\\'', '\\r', '\\n'), $vals['html']);
     unset($vals['ifname']);
     unset($vals['submit_button']);
     header('Content-Type: text/html; charset=' . intl_charset());
     echo template_simple('source_return.spt', array('ifname' => $i, 'html' => $html));
     exit;
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
 function onSubmit($vals)
 {
     loader_import('sitepoll.Comment');
     $c = new SitepollComment();
     $vals['ts'] = date('Y-m-d H:i:s');
     unset($vals['submit_button']);
     $c->add($vals);
     $ce = appconf('comments_email');
     if ($ce) {
         @mail($ce, intl_get('Poll Comment Notice'), template_simple('comment_email.spt', $vals), 'From: ' . 'sitepoll@' . site_domain());
     }
     page_title(intl_get('Comment Added'));
     echo template_simple('comment_added.spt', $vals);
 }
Exemplo n.º 11
0
 function onSubmit($vals)
 {
     loader_import('siteforum.Post');
     loader_import('siteforum.Filters');
     loader_import('siteforum.Topic');
     $p = new SiteForum_Post();
     if (!$p->modify($vals['id'], array('subject' => $vals['subject'], 'body' => $vals['body']))) {
         page_title(intl_get('Database Error'));
         echo '<p>' . intl_get('An error occurred.  Please try again later.') . '</p>';
         echo '<p>' . intl_get('Error Message') . ': ' . $p->error . '</p>';
         return;
     }
     $post = $p->get($vals['id']);
     page_title(intl_get('Post Updated'));
     echo template_simple('post_updated.spt', $post);
 }
Exemplo n.º 12
0
 function onSubmit($vals)
 {
     $vals['public'] = $vals['public'] ? 'yes' : 'no';
     if ($vals['website'] == 'http://') {
         $vals['website'] = '';
     }
     // 1. update sitellite_user
     $res = session_user_edit(session_username(), array('firstname' => $vals['firstname'], 'lastname' => $vals['lastname'], 'company' => $vals['company'], 'website' => $vals['website'], 'country' => $vals['country'], 'province' => $vals['province'], 'email' => $vals['email'], 'expires' => date('Y-m-d H:i:s', time() + 3600), 'public' => $vals['public'], 'profile' => $vals['profile'], 'sig' => $vals['sig'], 'modified' => date('Y-m-d H:i:s')));
     if (!$res) {
         page_title('Unknown Error');
         echo '<p>' . intl_get('An error occurred while updating your account.  Please try again later.') . '</p>';
         return;
     }
     // 2. respond
     page_title(intl_get('Preferences Saved'));
     echo template_simple('<p>Your account information been updated.  <a href="{site/prefix}/index/sitemember-app">{intl Click here to continue.}</a></p>');
 }
Exemplo n.º 13
0
 function onSubmit($vals)
 {
     if ($this->parameters['save'] == 'yes') {
         // save to sitellite_form_submission table
         $parts = explode(' ', $vals['name']);
         $first = array_shift($parts);
         $last = join(' ', $parts);
         db_execute('insert into sitellite_form_submission values (null, ?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', 1, 'Contact Form', $_SERVER['REMOTE_ADDR'], null, null, null, $first, $last, $vals['from'], null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, $vals['message']);
     }
     if (!@mail($this->parameters['email'], '[' . site_domain() . '] ' . intl_get('Contact Form'), template_simple('util_contact_email.spt', $vals), 'From: ' . $vals['name'] . ' <' . $vals['from'] . '>')) {
         page_title(intl_get('An Error Occurred'));
         echo '<p>' . intl_get('Our apologies, your message failed to be sent.  Please try again later.') . '</p>';
         return;
     }
     page_title(intl_get('Thank You'));
     echo template_simple('util_contact_thanks.spt');
 }
Exemplo n.º 14
0
 function onSubmit($vals)
 {
     // 1. add author if necessary
     if (!db_shift('select * from sitellite_news_author where name = ?', $vals['author'])) {
         db_execute('insert into sitellite_news_author (name) values (?)', $vals['author']);
     }
     // 2. submit story as 'draft'
     loader_import('cms.Versioning.Rex');
     $rex = new Rex('sitellite_news');
     $res = $rex->create(array('title' => $vals['title'], 'author' => $vals['author'], 'category' => $vals['category'], 'summary' => $vals['summary'], 'body' => $vals['body'], 'date' => date('Y-m-d'), 'sitellite_status' => 'draft', 'sitellite_access' => 'public'), 'Story submission.');
     $vals['id'] = $res;
     // 3. email notification
     @mail(appconf('submissions'), 'News Submission Notice', template_simple('submission_email.spt', $vals));
     // 4. thank you screen
     page_title(intl_get('Thank You!'));
     echo template_simple('submissions.spt');
 }
Exemplo n.º 15
0
 function onSubmit($vals)
 {
     // your handler code goes here
     chdir('inc/html');
     $out = shell_exec('../app/devtools/bin/tpl.sh ' . escapeshellarg($vals['setname']));
     chdir('../..');
     if (trim($out) == 'Your template set is ready, sir.') {
         chdir('inc/html');
         shell_exec('umask 0000; chmod -R 0777 ' . escapeshellarg($vals['setname']));
         chdir('../..');
         page_title(intl_get('Template Set Created'));
         echo template_simple('tpl_created.spt', $vals);
     } else {
         page_title(intl_get('An Error Occurred'));
         echo template_simple('error.spt', array('msg' => $out));
     }
 }
Exemplo n.º 16
0
 function SitewikiEditForm()
 {
     parent::MailForm(__FILE__);
     $level = 0;
     if (session_valid()) {
         $level++;
     }
     if (session_admin()) {
         $level++;
     }
     global $cgi;
     $res = db_fetch('select * from sitewiki_page where id = ?', $cgi->page);
     if (!$res) {
         $this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/sitewiki-edit-form?page=' . $cgi->page . '&unlock=1&ret=' . urlencode($_SERVER['HTTP_REFERER']) . '\'; return false"';
         if ($level >= appconf('default_edit_level')) {
             $this->new_page = true;
         } else {
             echo template_simple('not_visible.spt');
             $this->editable = false;
             return;
         }
         $this->widgets['view_level']->setValue(appconf('default_view_level'));
         $this->widgets['edit_level']->setValue(appconf('default_edit_level'));
     } else {
         $this->widgets['submit_button']->buttons[1]->extra = 'onclick="window.location.href = \'' . site_prefix() . '/index/sitewiki-edit-form?page=' . $cgi->page . '&unlock=1\'; return false"';
         if ($level < $res->edit_level) {
             echo template_simple('not_visible.spt');
             $this->editable = false;
             return;
         } else {
             $this->widgets['body']->setValue($res->body);
             $this->widgets['view_level']->setValue($res->view_level);
             $this->widgets['edit_level']->setValue($res->edit_level);
         }
     }
     if (!appconf('security_test')) {
         unset($this->widgets['security_test']);
     }
     if (!session_valid()) {
         unset($this->widgets['files']);
         unset($this->widgets['file_1']);
         unset($this->widgets['file_2']);
         unset($this->widgets['file_3']);
     }
 }
Exemplo n.º 17
0
 function onSubmit($vals)
 {
     ob_start();
     passthru(appconf('wvhtml_location') . ' --targetdir=cache ' . escapeshellarg($vals['doc']->tmp_name) . ' -');
     $html = ob_get_contents();
     ob_end_clean();
     list($one, $two) = explode('<!--Section Begins-->', $html);
     list($two, $three) = explode('<!--Section Ends-->', $two);
     loader_import('saf.HTML.Messy');
     $messy = new Messy();
     $two = $messy->clean($two);
     //echo '<pre>' . htmlentities ($two); exit;
     $two = str_replace('<p><div', '<div', $two);
     $two = str_replace('</div></p>', '</div>', $two);
     $vals['doc'] = $two;
     echo template_simple('importer.spt', $vals);
     exit;
 }
Exemplo n.º 18
0
    function onSubmit($vals)
    {
        $vals['public'] = $vals['public'] ? 'yes' : 'no';
        if ($vals['website'] == 'http://') {
            $vals['website'] = '';
        }
        $session_id = session_make_pending_key();
        $vals['verify'] = str_replace('PENDING:', '', $session_id);
        // 1. insert into sitellite_user
        $res = db_execute('
			insert into sitellite_user
				(username, password, firstname, lastname, company, website, country, province, email, session_id, role, team)
			values
				(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $vals['user_id'], better_crypt($vals['password']), $vals['firstname'], $vals['lastname'], $vals['company'], $vals['website'], $vals['country'], $vals['province'], $vals['email'], $session_id, 'member', 'core');
        if (!$res) {
            page_title('Unknown Error');
            echo '<p>An error occurred while creating your account.  Please try again later.</p>';
            echo '<p>Error Message: ' . db_error() . '</p>';
            return;
        }
        // 2. insert into org_profile
        /*db_execute (
        			'insert into org_profile
        				(user_id, public, about, sig)
        			values
        				(?, ?, ?, ?)',
        			$vals['user_id'],
        			$vals['public'],
        			$vals['about'],
        			$vals['sig']
        		);*/
        // 3. email confirmation
        @mail($vals['email'], 'Membership Confirmation', template_simple('member_confirmation.spt', $vals), 'From: ' . appconf('email'));
        // 4. log them in
        //global $cgi, $session;
        //$cgi->username = $cgi->user_id;
        //$session->username = $cgi->user_id;
        //$session->password = $cgi->password;
        //$session->start ();
        // 5. respond
        page_title(intl_get('Welcome') . ' ' . $vals['firstname'] . ' ' . $vals['lastname']);
        echo '<p>Your account has been created.  An email has also been sent to your address containing information necessary to activate your account.</p>';
    }
Exemplo n.º 19
0
 function onSubmit($vals)
 {
     $vals['public'] = $vals['public'] ? 'yes' : 'no';
     if ($vals['website'] == 'http://') {
         $vals['website'] = '';
     }
     $session_id = session_make_pending_key();
     $vals['verify'] = str_replace('PENDING:', '', $session_id);
     // 1. insert into sitellite_user
     $res = session_user_add(array('username' => $vals['user_id'], 'password' => better_crypt($vals['password']), 'firstname' => $vals['firstname'], 'lastname' => $vals['lastname'], 'company' => $vals['company'], 'website' => $vals['website'], 'country' => $vals['country'], 'province' => $vals['province'], 'email' => $vals['email'], 'session_id' => $session_id, 'role' => 'member', 'team' => 'none', 'public' => $vals['public'], 'profile' => $vals['about'], 'sig' => $vals['sig'], 'registered' => date('Y-m-d H:i:s'), 'modified' => date('Y-m-d H:i:s')));
     if (!$res) {
         page_title('Unknown Error');
         echo '<p>An error occurred while creating your account.  Please try again later.</p>';
         return;
     }
     // 2. email confirmation
     @mail($vals['email'], 'Membership Confirmation', template_simple('register_confirmation.spt', $vals), 'From: ' . appconf('email'));
     // 3. respond
     page_title(intl_get('Welcome') . ' ' . $vals['firstname'] . ' ' . $vals['lastname']);
     echo '<p>Your account has been created.  An email has also been sent to your address containing information necessary to activate your account.</p>';
 }
Exemplo n.º 20
0
function sitestreamer_flash($file, $width, $height, $fg = '0x444444', $bg = '0xAAAAAA')
{
    static $num = 0;
    $num++;
    if (@file_exists('inc/app/sitestreamer/lib/swfobject.js')) {
        $image = str_replace('.flv', '.jpg', $file);
        if (!@file_exists('inc/data' . $image)) {
            $image = '';
        }
        page_add_script(site_prefix() . '/inc/app/sitestreamer/lib/swfobject.js');
        return template_simple('<p align="center" class="sitestreamer-video" id="sitestreamer-video{num}"><a href="http://www.macromedia.com/go/getflashplayer">You need the Flash Player to watch this video.</a></p>
			<script type="text/javascript">
				var swfobj{num} = new SWFObject ("{site/prefix}/inc/app/sitestreamer/lib/player.swf", "sitestreamer-video", "{width}", "{height}", "9", "{bg}");
				swfobj{num}.addParam ("allowfullscreen","true");
				swfobj{num}.addParam ("flashvars", "file={site/prefix}/index/cms-filesystem-action{file}{if not empty (obj[image])}&image={site/prefix}/index/cms-filesystem-action{image}{end if}");
				swfobj{num}.write ("sitestreamer-video{num}");
			</script>', array('file' => $file, 'image' => $image, 'width' => $width, 'height' => $height, 'fg' => $fg, 'bg' => $bg, 'num' => $num));
    }
    sitestreamer_flvheader();
    $height += 40;
    return template_simple("<p align='center' class='sitestreamer-video'><object width='{width}' height='{height}' id='flvPlayer'>\r\n <param name='allowFullScreen' value='true'>\r\n <param name='movie' value='{site/prefix}/inc/app/sitestreamer/lib/player.swf?movie={site/prefix}/index/cms-filesystem-action{file}&fgcolor={fg}&bgcolor={bg}&volume=70'>\r\n <embed src='{site/prefix}/inc/app/sitestreamer/lib/player.swf?movie={site/prefix}/index/cms-filesystem-action{file}&fgcolor={fg}&bgcolor={bg}&volume=70' width='{width}' height='{height}' allowFullScreen='true' type='application/x-shockwave-flash'>\r\n</object></p>", array('file' => $file, 'width' => $width, 'height' => $height, 'fg' => $fg, 'bg' => $bg));
}
Exemplo n.º 21
0
    function onSubmit($vals)
    {
        // 1. insert into sitefaq_submission table
        if ($vals['url'] == 'http://') {
            $vals['url'] = '';
        }
        $member_id = session_username();
        if (!$member_id) {
            $member_id = '';
        }
        if (!$vals['name']) {
            $vals['name'] = '';
        }
        if (!$vals['age']) {
            $vals['age'] = '';
        }
        if (!$vals['url']) {
            $vals['url'] = '';
        }
        db_execute('insert into sitefaq_submission
				(id, question, answer, ts, assigned_to, email, member_id, ip, name, age, url, sitellite_status, sitellite_access, sitellite_owner, sitellite_team)
			values
				(null, ?, "", now(), "", ?, ?, ?, ?, ?, ?, "draft", "private", "", "none")', $vals['question'], $vals['email'], $member_id, $_SERVER['REMOTE_ADDR'], $vals['name'], $vals['age'], $vals['url']);
        // 2. email all admins
        $admin_roles = session_admin_roles();
        $emails = db_shift_array('select distinct email from sitellite_user
			where role in("' . join('", "', $admin_roles) . '")');
        foreach ($emails as $email) {
            @mail($email, intl_get('FAQ Submission Notice'), template_simple('email_notice.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
        }
        // 4. if the user provided an email address, send a thank you
        if (!empty($vals['email'])) {
            @mail($vals['email'], intl_get('FAQ Submission Received'), template_simple('email_thank_you.spt', $vals), 'From: faq@' . str_replace('www.', '', site_domain()));
        }
        // 3. output a thank you
        page_title(intl_get('Thank You'));
        echo template_simple('thank_you.spt', $vals);
    }
Exemplo n.º 22
0
}
switch ($event->recurring) {
    case 'yearly':
        $event->recur = intl_get('Yearly');
        break;
    case 'monthly':
        $event->recur = intl_get('Monthly');
        break;
    case 'weekly':
        $days = array(intl_get('Sundays'), intl_get('Mondays'), intl_get('Tuesdays'), intl_get('Wednesdays'), intl_get('Thursdays'), intl_get('Fridays'), intl_get('Saturdays'));
        list($y, $m, $d) = explode('-', $event->_date);
        $event->recur = $days[date('w', mktime(5, 0, 0, $m, $d, $y))];
        break;
    case 'daily':
    case 'no':
    default:
        if ($event->recurring == 'daily' || $event->until_date != '0000-00-00') {
            $event->recur = intl_get('Daily');
        } else {
            $event->recur = false;
        }
        break;
}
if (appconf('google_maps') && !empty($event->loc_address) && empty($event->loc_map)) {
    $event->loc_google = sprintf('<a href="http://local.google.com/maps?q=%s, %s, %s, %s" target="_blank">%s</a>', $event->loc_address, $event->loc_city, $event->loc_province, $event->loc_country, intl_get('Map'));
} else {
    $event->loc_google = false;
}
page_title(appconf('siteevent_title'));
echo template_simple('details.spt', $event);
Exemplo n.º 23
0
<?php

$info = session_get_user($parameters['user']);
if (!$info) {
    page_title(intl_get('Viewing User'));
    echo '<p>' . intl_get('Error') . ': ' . intl_get('User not found.') . '</p>';
}
if (empty($info->lastname)) {
    $name = $info->username;
} else {
    $name = $info->lastname . ', ' . $info->firstname;
}
page_title(intl_get('Viewing User') . ': ' . $name);
echo template_simple('user/view.spt', $info);
//info ($info);
Exemplo n.º 24
0
 /**
  * Returns the display HTML for this widget.  The optional
  * parameter determines whether or not to automatically display the widget
  * nicely, or whether to simply return the widget (for use in a template).
  * 
  * @access	public
  * @param	boolean	$generate_html
  * @return	string
  * 
  */
 function display($generate_html = 0)
 {
     $n = 0;
     $this->widgets = array();
     foreach ($this->form->widgets as $k => $w) {
         if ($w->type == 'tab') {
             $n++;
             $this->form->widgets[$k]->num = $n;
         } elseif ($n > 0) {
             switch ($w->type) {
                 case 'textarea':
                     $this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'document.getElementById (\'' . $w->name . '\').style.overflow = \'auto\';', 'off' => 'document.getElementById (\'' . $w->name . '\').style.overflow = \'hidden\';');
                     break;
                 case 'keywords':
                 case 'select':
                 case 'selector':
                 case 'position':
                 case 'template':
                 case 'multiple':
                 case 'team':
                 case 'access':
                 case 'status':
                     $this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'document.getElementById (\'' . $w->name . '\').style.display = \'inline\';', 'off' => 'document.getElementById (\'' . $w->name . '\').style.display = \'none\';');
                     break;
                 case 'xed':
                     $this->widgets[] = array('name' => $w->name, 'tabnum' => $n - 1, 'on' => 'xed_mode (\'' . $w->name . '\', \'on\');', 'off' => 'xed_mode (\'' . $w->name . '\', \'off\');');
                     break;
             }
         }
     }
     $this->tab_count = $n - 2;
     //info ($this->widgets);
     if ($this->num == 1) {
         // first
         return template_simple($this->template, $this);
     } elseif ($this->num == $n) {
         // last
         return template_simple($this->template_end, $this);
     }
     return template_simple($this->template_middle, $this);
 }
Exemplo n.º 25
0
<?php

echo template_simple('instructions_full.spt');
exit;
Exemplo n.º 26
0
<?php

loader_import('news.Story');
loader_import('news.Functions');
$story = new NewsStory();
$story->limit($parameters['limit']);
$story->orderBy('date desc, rank desc, id desc');
if (!isset($parameters['sec'])) {
    $params = array();
} else {
    $params = array('category' => $parameters['sec']);
}
$res = $story->find($params);
if (!$res) {
    $res = array();
}
echo template_simple('sidebar.spt', array('list' => $res, 'dates' => $parameters['dates'], 'thumbs' => $parameters['thumbs']));
Exemplo n.º 27
0
umask(00);
chmod('inc/app/siteinvoice/data/' . $invoice_id . '.pdf', 0777);
if ($cgi->send_invoice == 'yes') {
    // get client info
    $client = db_single('select * from siteinvoice_client where id = ?', $cgi->client);
    $client->invoice_no = $invoice_id;
    $client->total = $total;
    $client->currency = $cgi->currency;
    // send email to client
    loader_import('ext.phpmailer');
    $mailer = new PHPMailer();
    $mailer->isMail();
    $mailer->From = appconf('company_email');
    $mailer->FromName = appconf('company_email_name');
    $mailer->Subject = 'Invoice #' . $invoice_id;
    $mailer->Body = template_simple('email/initial.spt', $client);
    $mailer->AddAttachment('inc/app/siteinvoice/data/' . $invoice_id . '.pdf', strtolower($client->code) . '-' . $invoice_id . '.pdf');
    $mailer->AddAddress($client->contact_email, $client->contact_name);
    $bcc_list = appconf('bcc_list');
    if (!empty($bcc_list)) {
        $bcc = appconf('company_email') . ', ' . $bcc_list;
    } else {
        $bcc = appconf('company_email');
    }
    $mailer->AddBCC($bcc);
    $mailer->Send();
    // reply on screen
    page_title('SiteInvoice - Invoice Sent');
} else {
    page_title('SiteInvoice - Invoice Created');
}
Exemplo n.º 28
0
<?php

loader_box('sitellite/nav/init');
global $menu, $page;
if ($page->id != 'index') {
    if (!empty($parameters['caption'])) {
        $caption = $parameters['caption'] . ': ';
    } else {
        $caption = '';
    }
    if ($parameters['home_link'] == 'no') {
        $home = false;
    } else {
        $home = true;
    }
    if ($page->below_page && !isset($menu->{'items_' . $page->id})) {
        $menu->addItem($page->id, $page->title, $page->below_page);
        $added = true;
    } else {
        $added = false;
    }
    if ($menu->{'items_' . $page->id}) {
        echo '<p class="breadcrumb">' . '<span class="caption">' . $caption . '</span>' . $menu->trail($page->id, 'nav/breadcrumb/link.spt', $home, ' / ') . '</p>' . NEWLINEx2;
    } elseif (!empty($page->title)) {
        echo '<p class="breadcrumb">' . '<span class="caption">' . $caption . '</span>' . template_simple('nav/breadcrumb/link_home.spt', array('id' => 'index', 'title' => intl_get('Home'))) . ' / ' . $page->title . '</p>' . NEWLINEx2;
    }
    if ($added) {
        unset($menu->{'items_' . $page->id});
    }
}
Exemplo n.º 29
0
<?php

$types = array('users' => 'user', 'roles' => 'role', 'teams' => 'team', 'resources' => 'resource', 'statuses' => 'status', 'accesslevels' => 'access');
$names = array('users' => 'user', 'roles' => 'role', 'teams' => 'team', 'resources' => 'resource', 'statuses' => 'status', 'accesslevels' => 'access level');
global $cgi;
if (!in_array($cgi->_list, array_keys($types))) {
    header('Location: ' . site_prefix() . '/index/usradm-browse-action');
    exit;
}
$snm =& session_get_manager();
$form =& $snm->{$types[$cgi->_list]}->getAddForm();
if ($form->invalid($cgi)) {
    $form->setValues($cgi);
    echo '<h1>' . intl_get('Adding') . ': ' . $names[$cgi->_list] . '</h1>' . NEWLINEx2;
    echo $form->show();
} else {
    $form->setValues($cgi);
    $vals = $form->getValues();
    unset($vals['_list']);
    unset($vals['submit_button']);
    $res = $snm->{$types[$cgi->_list]}->add($vals);
    if (!$res) {
        die($snm->{$types[$cgi->_list]}->error);
    }
    echo '<h1>' . intl_get('Added') . ' ' . $names[$cgi->_list] . '</h1>' . NEWLINEx2;
    echo template_simple('<p><a href="{site/prefix}/index/usradm-browse-action?list={cgi/_list}">Back</a></p>');
}
exit;
Exemplo n.º 30
0
    function _link()
    {
        // display a button that pops up the filechooser app
        static $included = false;
        if (!$included) {
            page_add_script(site_prefix() . '/js/dialog.js');
            page_add_script(loader_box('filechooser/js'));
            $included = true;
        }
        return template_simple('
			<script language="javascript" type="text/javascript">

				function filechooser_handler () {
					if (typeof dialogWin.returnedValue == \'object\') {
						url = \'{site/url}\' + dialogWin.returnedValue[\'src\'];
					} else {
						url = \'{site/url}\' + dialogWin.returnedValue;
					}
					filechooser_form.elements[filechooser_element].value = url;
				}

				function filechooser_view_current (src) {
					if (src.length > 0) {
						filechooser_view (src);
					}
					return false;
				}

			</script>

			{if obj.view_current}
			<input type="submit" onclick="return filechooser_view_current (this.form.elements[\'{name}\'].value)" value="{intl View Current}" />
			{end if}
			<input type="submit" onclick="filechooser_get_file (this.form, \'{name}\'); return false" value="{intl Choose}" />
		', $this);
    }