本文整理匯總了PHP中slot函數的典型用法代碼示例。如果您正苦於以下問題:PHP slot函數的具體用法?PHP slot怎麽用?PHP slot使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了slot函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: use_plop_theme
/**
* Set the theme
* @param Mixed $css String or array
*/
function use_plop_theme($class = '', $theme = null)
{
if (!$theme) {
$theme = sfPlop::get('sf_plop_theme');
}
if (preg_match('/\\s/', $theme) !== false) {
$subthemes = explode(' ', $theme);
$theme = array_shift($subthemes);
$class .= ' ' . implode(' ', $subthemes);
}
$themes = sfPlop::get('sf_plop_loaded_themes');
if ($theme != false && is_string($theme) && isset($themes[$theme])) {
if (isset($themes[$theme]['css'])) {
use_plop_stylesheet($themes[$theme]['css']);
}
if (isset($themes[$theme]['js'])) {
use_plop_javascript($themes[$theme]['js']);
}
} else {
$theme = '';
}
if (has_slot('sf_plop_theme') && $theme == sfPlop::get('sf_plop_theme')) {
slot('sf_plop_theme', get_slot('sf_plop_theme') . $theme . ' ' . $class);
} else {
slot('sf_plop_theme', $theme . ' ' . $class);
}
}
示例2: ajax_kik
public function ajax_kik()
{
$this->loadData();
list($nb_red, $nb_blue) = self::compterSignes($this->grille);
$x = intval(getValue('x'));
$y = intval(getValue('y'));
$charat = $y * 3 + $x;
if ($this->grille[$charat] == 0 && $nb_red - $nb_blue + 1 == intval(slot()->position)) {
$this->grille[$charat] = intval(slot()->position);
$this->saveData();
}
$winner = self::checkTicTacToe($this->grille);
switch ($winner['etat']) {
case 0:
return $this->ajax_update();
case 1:
case 2:
$slots = partie()->getSlots();
$slots[$winner['etat'] - 1]->addScore(1, true);
$r = $this->terminer();
$r->highlight = $winner['highlight'];
$r->grid = $this->grille;
return $r;
case 3:
$slots = partie()->getSlots();
$r = $this->terminer();
$r->highlight = $winner['highlight'];
$r->grid = $this->grille;
return $r;
default:
throw new Exception('grille de Tic Tac Toe impossible : ' . $winner);
}
}
示例3: executeIndex
/**
* Searches for coordinators
* CODE: coordinator_index, coordinator_create
*/
public function executeIndex(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->getUser()->addRecentItem('Coordinator', 'Coordinator', 'coordinator/index');
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
if ($request->hasParameter('coor_for') && $this->getUser()->hasCredential(array('Administrator', 'Staff'), false)) {
$this->coor_for = CoordinatorPeer::retrieveByPK($request->getParameter('coor_for'));
} else {
$this->coor_for = null;
}
$exclude_ids = array();
if ($this->master_for) {
$exclude_ids[] = $this->master_for->getId();
}
# filter
$this->processFilter($request);
$this->pager = CoordinatorPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->country, $this->coor_of_week, $exclude_ids);
$this->coordinators = $this->pager->getResults();
# one result with coordinator_id search will go to coordinator view
if (count($this->coordinators) == 1) {
if ($this->coor_for) {
$url_add = '&coor_for=' . $this->coor_for->getId();
} else {
$url_add = '';
}
$this->redirect('@coordinator_view?id=' . $this->coordinators[0]->getId() . $url_add);
}
}
示例4: process
public function process()
{
$this->initRegles();
$this->initPlateau();
$this->addJs(WWW_JS . 'jquery.event.drag.min.js');
$demi = $this->regles->taille_plateau / 2;
$nb_pion = $demi * ($demi - 1);
smarty()->assign(array('plateau_inverse' => intval(slot()->position) == 1, 'regles' => $this->regles, 'nb_joueur' => partie()->getNbJoueur()));
}
示例5: executeIndex
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
//removing used session like person id
$id = $this->getUser()->getAttribute('person_id');
unset($id);
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('instrument'));
# for navigation menu
}
示例6: executeUpdate
/**
* Add or edit afaorgs
* It also handles followings:
* CODE: afaorg_create
*/
public function executeUpdate(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('reference', ''));
if ($request->getParameter('id')) {
$afa = AfaOrgPeer::retrieveByPK($request->getParameter('id'));
$this->forward404Unless($afa);
$this->title = 'Edit Linking Organization';
$success = 'Linking Organization information has been successfully changed!';
} else {
$afa = new AfaOrg();
$this->title = 'Add Linking Organization';
$success = 'Linking Organization information has been successfully created!';
}
$this->form = new AfaOrgForm($afa);
if ($request->isMethod('post')) {
$this->referer = $request->getReferer();
$this->form->bind($request->getParameter('afa'));
if ($this->form->isValid()) {
$afa->setName($this->form->getValue('name'));
$afa->setOrgPhone($this->form->getValue('org_phone'));
$afa->setHomePageUrl($this->form->getValue('home_page_url'));
$afa->setOrgFax($this->form->getValue('org_fax'));
$afa->setRefContactName($this->form->getValue('ref_contact_name'));
$afa->setRefContactEmail($this->form->getValue('ref_contact_email'));
$afa->setVpoSoapServerUrl($this->form->getValue('vpo_soap_server_url'));
$afa->setVpoRequestPostEmail($this->form->getValue('vpo_request_post_email'));
$afa->setVpoUserId($this->form->getValue('vpo_user_id'));
$afa->setVpoUserPassword($this->form->getValue('vpo_user_password'));
$afa->setVpoOrgId($this->form->getValue('vpo_org_id'));
$afa->setAfidsRequesterUserName($this->form->getValue('afids_requester_user_name'));
$afa->setAfidsRequesterPassword($this->form->getValue('afids_requester_password'));
$afa->setAfidsSoapServerUrl($this->form->getValue('afids_soap_server_url'));
$afa->setAfidsRequestPostEmail($this->form->getValue('afids_request_post_email'));
$afa->setPhoneNumber1($this->form->getValue('phone_number1'));
$afa->setPhoneNumber2($this->form->getValue('phone_number2'));
if ($afa->isNew()) {
$content = $this->getUser()->getName() . ' added Linking Organization: ' . $afa->getName();
ActivityPeer::log($content);
}
$afa->save();
$this->getUser()->setFlash('success', $success);
return $this->redirect('@afaOrg');
}
} else {
# Set referer URL
$this->referer = $request->getReferer() ? $request->getReferer() : '@afaorg';
}
$this->afa = $afa;
}
示例7: ui_select_pager
/**
* Set a slot and returns the HTML for a uiSelectPager.
*
* The slot allows to re-print the pager at the top and bottom of a table by
* running the pager template only once.
*
* Examples:
*
* echo ui_select_pager($pager)
* => Set and print the pager slot with the default slot name
* echo ui_select_pager()
* => Print the HTML for previously set slot
* echo ui_select_pager($pager, 'pager2')
* => Print and set a pager with a custom slot name
* (allows different pagers on one template)
* echo ui_select_pager(false, 'pager2')
* => Print previously set pager with custom slot name
*
* @param mixed $pager uiSelectPager object or false
* @param string $slot Slot name, leave out to use the default
*
* @return string HTML representation
*/
function ui_select_pager($pager = false, $slot = 'widgets.ui.pager')
{
if ($pager !== false) {
slot($slot);
$view = new coreView(coreContext::getInstance());
$view->getParameterHolder()->add(array('pager' => $pager));
$view->setTemplate(dirname(__FILE__) . '/templates/ui_select_pager.php');
echo $view->render();
end_slot();
}
return get_slot($slot);
}
示例8: process
public function process()
{
$slots = queryTab('
select * from slot
natural join joueur
where partie_id=' . partie()->getID() . '
order by slot_position
');
smarty()->assign('slots', $slots);
smarty()->assign('options', jeu()->getOptions());
smarty()->assign('isHost', intval(slot()->joueur_id) == intval(partie()->host));
}
示例9: seoIndex
function seoIndex($object)
{
$indexable = $object->getPeanutSeo()->getIsIndexable();
$followable = $object->getPeanutSeo()->getIsFollowable();
if ($indexable && $followable) {
return slot('robots', sprintf('index, follow'));
} elseif ($indexable && !$followable) {
return slot('robots', sprintf('index, nofollow'));
} elseif (!$indexable && $followable) {
return slot('robots', sprintf('noindex, follow'));
} else {
return slot('robots', sprintf('noindex, nofollow'));
}
}
示例10: executeIndex
/**
* Searches for pilot
* CODE: pilot_index
*/
public function executeIndex(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->getUser()->addRecentItem('Pilot', 'pilot', 'pilot/index');
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
# filter
$this->processFilter($request);
if ($request->isMethod('post') || $request->getParameter('page')) {
$this->pager = PilotPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->wing_name, $this->flight_status, $this->available, $this->identifier, $this->ifr_rated, $this->n_number, $this->make, $this->model, $this->hseat_status, $this->transplant);
$this->pilots = $this->pager->getResults();
}
}
示例11: executeIndex
/**
* missionRequests
* CODE:miss_req_index
* TODO:Mission Request Filter , Find
*/
public function executeIndex(sfWebRequest $request)
{
#security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
# handle the master member
# filter
$this->processFilter($request);
$this->pager = MissionRequestPeer::getPager($this->max, $this->page, $this->request_date1, $this->request_date2, $this->mission_date1, $this->mission_date2, $this->standart, $this->referrals);
$this->mission_reqs = $this->pager->getResults();
$this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
$this->getUser()->addRecentItem('Mission request', 'missionRequest', 'missionRequest/index');
}
示例12: executeIndex
/**
* Search companions
* CODE: companion_index
*/
public function executeIndex(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->companion_list = CompanionPeer::doSelect(new Criteria());
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
# filter
$this->processFilter($request);
if ($request->isMethod('post') || $request->getParameter('page')) {
$this->pager = CompanionPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->name, $this->relationship);
$this->companions = $this->pager->getResults();
}
$this->getUser()->addRecentItem('Companions', 'companions', 'companions/index');
}
示例13: executeIndex
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('instrument', ''));
#security
/* if( !$this->getUser()->hasCredential(array('Administrator','Staff','Pilot','Member','Coordinator','Volunteer'), false)){
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url '.$request->getReferer());
$this->redirect('dashboard/index');
}*/
if ($request->getParameter('type')) {
$this->flag = 1;
}
if ($request->hasParameter('return')) {
$this->pilot_request = 1;
}
if ($request->hasParameter('avail')) {
$this->window_loc = 'avail';
}
if ($request->hasParameter('window_loc_visual')) {
$this->window_loc_visual = 'window_loc_visual';
}
$member_id = $this->getUser()->getMemberId();
$member = MemberPeer::retrieveByPK($member_id);
$pilot = $member->getPilot();
if ($request->getParameter('first') == 1) {
if ($pilot) {
$first_airport = AirportPeer::retrieveByPK($pilot->getPrimaryAirportId());
$this->orgin_airport = $first_airport->getIdent();
}
$this->types = MissionTypePeer::getOnlyNames();
$this->dest_airport = null;
$this->miss_type = null;
$this->miss_date1 = null;
$this->miss_date2 = null;
} else {
$this->processFilterVisual($request);
}
$this->airport_list = AirportPeer::getMappable();
$this->legs = MissionLegPeer::getMappable($this->orgin_airport, $this->dest_airport, $this->miss_type, $this->miss_date1, $this->miss_date2);
$this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text'));
}
示例14: executeIndex
/**
* Searches for requesters
* CODE: requester_index
*/
public function executeIndex(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
if ($request->hasParameter('mission_for')) {
//$mission_leg = MissionLegPeer::retrieveByPK($request->getParameter('mission_for'));
$this->mission_for = MissionPeer::retrieveByPK($request->getParameter('mission_for'));
$this->can_use = 1;
} else {
$this->change_id = null;
}
$exclude_ids = array();
if ($this->mission_for) {
$exclude_ids[] = $this->mission_for->getId();
}
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
# filter
$this->processFilter($request);
if ($request->isMethod('post') || $request->getParameter('page')) {
$this->pager = RequesterPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->agency_name, $exclude_ids);
$this->requesters = $this->pager->getResults();
}
# one result with member_id search will go to member view
if (count($this->requesters) == 1) {
if ($this->mission_for) {
$url_add = '&mission_for=' . $this->mission_for->getId();
} else {
$url_add = '';
}
if ($request->getParameter('mission_for')) {
$this->redirect('@leg_edit?id=' . $request->getParameter('mission_for') . $url_add);
}
}
$this->getUser()->addRecentItem('Requesters', 'requesters', 'requester/index');
}
示例15: executeIndex
/**
* Searches for members
* It also handles followings:
* * Master member of a member
* CODE: member_index
*/
public function executeIndex(sfWebRequest $request)
{
# security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Pilot', 'Member', 'Coordinator', 'Volunteer'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->getUser()->addRecentItem('Member', 'member', 'member/index');
# for navigation menu
sfContext::getInstance()->getConfiguration()->loadHelpers('Partial');
slot('nav_menu', array('mission_coord', ''));
# handle the master member
if ($request->hasParameter('master_for') && $this->getUser()->hasCredential(array('Administrator', 'Staff', 'Member'), false)) {
$this->master_for = MemberPeer::retrieveByPK($request->getParameter('master_for'));
} else {
$this->master_for = null;
}
// $this->member_id = $this->getRequestParameter('member_id');
$exclude_ids = array();
if ($this->master_for) {
$exclude_ids[] = $this->master_for->getId();
}
# filter
$this->processFilter($request);
if ($request->isMethod('post') || $request->getParameter('page')) {
$this->pager = MemberPeer::getPager($this->max, $this->page, $this->member_Ex_id, $this->firstname, $this->lastname, $this->city, $this->state, $this->country, $this->wing_name, $this->active, $this->flight_status, $exclude_ids);
$this->members = $this->pager->getResults();
}
$this->is_active = $request->getParameter('actives');
# one result with member_id search will go to member view
if (count($this->members) == 1 && $this->member_id > 0) {
if ($this->master_for) {
$url_add = '&master_for=' . $this->master_for->getId();
} else {
$url_add = '';
}
$this->redirect('@member_view?id=' . $this->members[0]->getId() . $url_add);
}
}