本文整理匯總了PHP中app::getProjectChoicesByUser方法的典型用法代碼示例。如果您正苦於以下問題:PHP app::getProjectChoicesByUser方法的具體用法?PHP app::getProjectChoicesByUser怎麽用?PHP app::getProjectChoicesByUser使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app
的用法示例。
在下文中一共展示了app::getProjectChoicesByUser方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: executeNew
public function executeNew(sfWebRequest $request)
{
if ($request->hasParameter('projects_id')) {
$this->forward404Unless($projects = Doctrine_Core::getTable('Projects')->createQuery()->addWhere('id=?', $request->getParameter('projects_id'))->fetchOne(), sprintf('Object projects does not exist (%s).', $request->getParameter('projects_id')));
$this->checkProjectsAccess($projects);
$this->checkDiscussionsAccess('insert', false, $projects);
$this->form = new DiscussionsForm(null, array('projects' => $projects, 'sf_user' => $this->getUser()));
} else {
$this->checkDiscussionsAccess('insert');
}
$this->choices = app::getProjectChoicesByUser($this->getUser(), true, 'discussions', true);
if (count($this->choices) == 2) {
unset($this->choices['']);
}
}
示例2: explode
<table>
<tr>
<?php
echo app::getReportFormFilterByTable('Status', 'projects_reports[projects_status_id]', 'ProjectsStatus', $form['projects_status_id']->getValue());
?>
<?php
echo app::getReportFormFilterByTable('Type', 'projects_reports[projects_type_id]', 'ProjectsTypes', $form['projects_type_id']->getValue());
?>
</tr>
</table>
</td>
<?php
if (count($choices = app::getProjectChoicesByUser($sf_user, true)) > 0) {
if (!is_string($v = $form['projects_id']->getValue())) {
$v = '';
}
echo '<td style="padding-right: 10px;"><b>' . __('Projects') . '</b><br>' . select_tag('projects_reports[projects_id]', explode(',', $v), array('choices' => $choices, 'multiple' => true), array('style' => 'height: 400px; width: 250px;')) . '</td>';
}
if (count($choices = app::getItemsChoicesByTable('Users', true)) > 0 and (Users::hasAccess('insert', 'projects', $sf_user) or Users::hasAccess('edit', 'projects', $sf_user))) {
if (!is_string($v = $form['in_team']->getValue())) {
$v = '';
}
echo '<td style="padding-right: 10px;"><b>' . __('In Team') . '</b><br>' . select_tag('projects_reports[in_team]', explode(',', $v), array('choices' => $choices), array('style' => 'width: 250px;')) . '</td>';
}
?>
</tr>
</table>
示例3: __
<td>
<table>
<tr>
<?php
echo app::getReportFormFilterByTable('Status', 'projects_reports[projects_status_id]', 'ProjectsStatus', $form['projects_status_id']->getValue());
?>
<?php
echo app::getReportFormFilterByTable('Type', 'projects_reports[projects_type_id]', 'ProjectsTypes', $form['projects_type_id']->getValue());
?>
</tr>
</table>
</td>
<?php
if (count($choices = app::getProjectChoicesByUser($sf_user, true, 'discussions')) > 0) {
if (!is_string($v = $form['projects_id']->getValue())) {
$v = '';
}
echo '<td style="padding-right: 10px;"><b>' . __('Projects') . '</b><br>' . select_tag('discussions_reports[projects_id]', explode(',', $v), array('choices' => $choices, 'multiple' => true), array('style' => 'height: 400px; width: 250px;')) . '</td>';
}
?>
</tr>
</table>
</div>
</div>
<br>
<input type="submit" value="<?php
echo __('Save');
?>