コード例 #1
0
function displayTLCUsers($which, $display_type = '')
{
    $users = getTLCUsers($which);
    if ($display_type == 'admin') {
        $template_name = 'admin/list_tlc_users_admin.tpl';
    } else {
        $template_name = 'admin/list_tlc_users.tpl';
    }
    $tpl = new PSU\Template();
    $tpl->assign('users', $users);
    return $tpl->fetch($template_name);
}
コード例 #2
0
 public static function mail($id)
 {
     $tpl = new PSU\Template();
     $f = PSU::db('myplymouth')->GetRow("SELECT * FROM anejf WHERE id_ = ?", array($id));
     $form = new AnejfApply($f, true);
     $form->readonly(true);
     $tpl->assign('form', $form);
     $message = $tpl->fetch('email.tpl');
     $to = '*****@*****.**';
     if (PSU::isdev()) {
         $to = '*****@*****.**';
     }
     $subject = sprintf("[ANEJF %d] Application for %s %s", $GLOBALS['ANEJF']['YEAR'], $form->first_name->value(), $form->last_name->value());
     PSU::mail($to, $subject, $message, 'Content-Type: text/html');
 }
コード例 #3
0
ファイル: index.php プロジェクト: AholibamaSI/plymouth-webapp
        if (preg_match('/_o\\.jpg/', $matches[0])) {
            $matches[0] = str_replace('_o.jpg', '_s.jpg', $matches[0]);
        } elseif (preg_match('/_m\\.jpg/', $matches[0])) {
            ///nothing;
        } elseif (!preg_match('/_sq\\.jpg/', $matches[0]) && !preg_match('/_s\\.jpg/', $matches[0]) && !preg_match('/_t\\.jpg/', $matches[0])) {
            $matches[0] = str_replace('.jpg', '_m.jpg', $matches[0]);
        }
    }
    $text = str_replace($orgstr, $matches[0], $text);
    $text = preg_replace('/<script\\b[^>]*>(.*?)<\\/script>/i', '', $text);
    $item->out_text = $text;
    $entries[] = $item;
    //There's no need to process more items than have been requested, so break
    //when that ammount has been reached.
    if (count($entries) >= $num) {
        break;
    }
    //end if
}
//end foreach
/**
 * Assign all of our relevant variables to the template.
 * We can do this using compact in the assign, and we will have
 * associated variables that we can call in the template.
 *
 * Ex. if we have an array $entries here, we will have an array variable called 
 * entries in the template...
 */
$tpl->assign(compact('title', 'rss', 'desc', 'id', 'mycomics', 'summary', 'link_text', 'entries'));
//Display the template
$tpl->display('index.tpl');
コード例 #4
0
respond(function ($request, $response, $app) {
    PSU::session_start();
    $GLOBALS['BASE_URL'] = '/app/festivals/music-career-day';
    $app->event_year = 2012;
    $GLOBALS['TITLE'] = "{$app->event_year} Music Technology and Education Career Day";
    $GLOBALS['TEMPLATES'] = PSU_BASE_DIR . '/app/festivals/music-career-day/templates';
    if (!isset($_SESSION['mtecd'])) {
        $_SESSION['mtecd'] = array();
    }
    $app->mail = function ($id) {
        $tpl = new PSU\Template();
        $f = PSU::db('myplymouth')->GetRow("SELECT * FROM mte_career_day WHERE id_ = ?", array($id));
        $form = new PSU\Festivals\MusicCareerDay\Model($f, true);
        $form->readonly(true);
        $tpl->assign('form', $form);
        $message = $tpl->fetch('email.tpl');
        $to = array('*****@*****.**');
        if (PSU::isdev()) {
            $to[0] = '*****@*****.**';
        }
        $subject = sprintf("[MTECD {$app->event_year}] Application for %s %s", $form->first_name->value(), $form->last_name->value());
        PSU::mail($to, $subject, $message, 'Content-Type: text/html');
    };
    $app->tpl = new PSU\Template();
    $app->tpl->assign('event_year', $app->event_year);
});
respond('/apply', function ($request, $response, $app) {
    $f = isset($_SESSION['mtecd']['f']) ? $_SESSION['mtecd']['f'] : array();
    $form = new PSU\Festivals\MusicCareerDay\Model($f);
    $app->tpl->assign('form', $form);
コード例 #5
0
require dirname(__DIR__) . '/webapp/calllog/includes/functions/open_call_functions.php';
// needed to fetch open calls
$GLOBALS['db'] = PSU::db('calllog');
$GLOBALS['BANNER'] = PSU::db('banner');
$GLOBALS['BannerGeneral'] = new BannerGeneral($GLOBALS['BANNER']);
$GLOBALS['user'] = new User(PSU::db('calllog'));
$HOST = 'https://www.plymouth.edu';
$GLOBALS['BASE_URL'] = $HOST . '/webapp/calllog';
$GLOBALS['BASE_DIR'] = dirname(__FILE__);
$GLOBALS['TEMPLATES'] = dirname(__DIR__) . '/webapp/calllog/templates';
$GLOBALS['CALLLOG_WEB'] = $GLOBALS['BASE_URL'] . '/calls/my/';
$tpl = new PSU\Template();
$users = getTLCUsers('active');
foreach ($users as $person) {
    $reminder = $GLOBALS['user']->getReminderSetting($person['user_name']);
    if ($reminder == 'yes') {
        $options = array('which' => 'my', 'who' => $person['user_name']);
        $calls = getOpenCalls($options);
        if (count($calls) > 0) {
            $tpl->assign('calls', $calls);
            $tpl->assign('user', $person);
            $html = $tpl->fetch('email.calls.tpl');
            $text = 'This email is optimized for HTML.  View your open calls here: ' . $GLOBALS['CALLLOG_WEB'];
            $p = new PSUPerson($person['user_name']);
            PSU::mail($p->email['CA'][0], '[CallLog] Daily Open Call Report', array($text, $html));
        }
        // end if
    }
    // end if
}
// end foreach