本文整理汇总了PHP中Engine_Api类的典型用法代码示例。如果您正苦于以下问题:PHP Engine_Api类的具体用法?PHP Engine_Api怎么用?PHP Engine_Api使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Engine_Api类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$view = Zend_Registry::get('Zend_View');
$this->setTitle('Delete Sub Library');
$this->setAttrib('class', 'global_form_popup');
$this->setDescription('Are you sure that you want to delete this library? It will not be recoverable after being deleted.');
//get table
$mappingTable = Engine_Api::_()->getDbTable('mappings', 'user');
//get videos mapping of library
$params = array();
$params['owner_type'] = $this->_library->getType();
$params['owner_id'] = $this->_library->getIdentity();
$videoMappings = $mappingTable->getItemsMapping('video', $params);
if (count($this->_subs) && count($videoMappings)) {
//get main Library
$viewer = Engine_Api::_()->user()->getViewer();
$mainLibrary = $viewer->getMainLibrary();
$arrValue = array();
$arrValue[0] = $view->translate('None');
$arrValue[$mainLibrary->getIdentity()] = $view->translate($mainLibrary->getTitle());
foreach ($this->_subs as $sub) {
if ($sub->isSelf($this->_library)) {
continue;
}
$arrValue[$sub->getIdentity()] = $view->translate($sub->getTitle());
}
$this->addElement('Select', 'move_to', array('label' => 'Move to Library?', 'description' => 'If you delete this library, all existing content will be moved to another one.', 'multiOptions' => $arrValue));
}
$this->addElement('Button', 'submit_button', array('value' => 'submit_button', 'label' => 'Delete', 'onclick' => 'removeSubmit()', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
$this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
$this->addDisplayGroup(array('submit_button', 'cancel'), 'buttons', array('decorators' => array('FormElements', 'DivDivDivWrapper')));
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:32,代码来源:Delete.php
示例2: init
public function init()
{
$this->clearDecorators()->addDecorator('FormElements')->addDecorator('Form')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'search'))->addDecorator('HtmlTag2', array('tag' => 'div', 'class' => 'clear'));
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'))->setMethod('GET');
$types = Engine_Api::_()->getDbtable('modules', 'ynmoderation')->getTypesAssoc();
$typeMultiOptions = array(0 => ' ');
foreach ($types as $key => $value) {
$typeMultiOptions[$key] = $value;
}
$type_id = new Zend_Form_Element_Select('type_id');
$type_id->setLabel('Type')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions($typeMultiOptions);
$description = new Zend_Form_Element_Text('description');
$description->setLabel('Description')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
$submit = new Zend_Form_Element_Button('search', array('type' => 'submit'));
$submit->setLabel('Search')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))->addDecorator('HtmlTag2', array('tag' => 'div'));
$this->addElement('Hidden', 'order', array('order' => 10001));
$this->addElement('Hidden', 'order_direction', array('order' => 10002));
$this->addElements(array($type_id, $description, $submit));
// Set default action without URL-specified params
$params = array();
foreach (array_keys($this->getValues()) as $key) {
$params[$key] = null;
}
$this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble($params));
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:25,代码来源:Filter.php
示例3: indexAction
public function indexAction()
{
$this->view->form = $form = new Ynnotification_Form_Admin_Style();
$values = Engine_Api::_()->getApi('settings', 'core')->getSetting('avdnotification.customcssobj', 0);
$values = Zend_JSON::decode($values);
if ($values) {
$form->populate($values);
}
if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {
$values = $form->getValues();
if (isset($_POST['submit'])) {
// $str = $this->view->partial("_css.tpl");
$arr_keys = array_keys($values);
$arr_values = array_values($values);
$arr_keys = array_map(array($this, 'map'), $arr_keys);
$str = str_replace($arr_keys, $arr_values, $str);
Engine_Api::_()->getApi('settings', 'core')->setSetting('avdnotification.customcssobj', Zend_JSON::encode($values));
Engine_Api::_()->getApi('settings', 'core')->setSetting('avdnotification', $str);
$form->addNotice('Your changes have been saved.');
} else {
if (isset($_POST['clear'])) {
Engine_Api::_()->getApi('settings', 'core')->setSetting('avdnotification.customcssobj', '');
Engine_Api::_()->getApi('settings', 'core')->setSetting('avdnotification', '');
$form->populate(array('mes_background' => '79B4D4', 'text_color' => ''));
$form->addNotice('You have set default styles.');
}
}
}
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:29,代码来源:AdminStylesController.php
示例4: _initLog
protected function _initLog()
{
$log = new Zend_Log();
// Non-production
if (APPLICATION_ENV !== 'production') {
$log->addWriter(new Zend_Log_Writer_Firebug());
}
// Production
try {
$log->addWriter(new Zend_Log_Writer_Stream(APPLICATION_PATH . '/temporary/log/install.log'));
} catch (Exception $e) {
// Check directory
if (!@is_dir(APPLICATION_PATH . '/temporary/log') && @mkdir(APPLICATION_PATH . '/temporary/log', 0777, true)) {
$log->addWriter(new Zend_Log_Writer_Stream(APPLICATION_PATH . '/temporary/log/install.log'));
} else {
// Silence ...
if (APPLICATION_ENV !== 'production') {
$log->log($e->__toString(), Zend_Log::CRIT);
} else {
// Make sure logging doesn't cause exceptions
$log->addWriter(new Zend_Log_Writer_Null());
}
}
}
Zend_Registry::set('Zend_Log', $log);
Engine_Api::registerErrorHandlers();
if ('production' != APPLICATION_ENV) {
Engine_Exception::setLog($log);
}
return $log;
}
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:31,代码来源:Bootstrap.php
示例5: onUserLoginAfter
public function onUserLoginAfter($event)
{
// Arg should be an instance of Zend_View
$user = $event->getPayload();
if (!isset($user->email)) {
return;
}
if (!$user instanceof User_Model_User || empty($user->email)) {
return;
}
$settings = Engine_Api::_()->getApi('settings', 'core');
if (!$settings->getSetting('ynfeedback_guest_merge', 1)) {
return;
}
$email = $user->email;
$ideaTable = Engine_Api::_()->getItemTable('ynfeedback_idea');
$data = array('user_id' => $user->getIdentity());
$where = $ideaTable->getAdapter()->quoteInto('guest_email = ?', $email);
$idea = $ideaTable->update($data, $where);
$commentTable = Engine_Api::_()->getDbTable('comments', 'ynfeedback');
$data = array('poster_id' => $user->getIdentity());
$where = $commentTable->getAdapter()->quoteInto('poster_email = ?', $email);
$comment = $commentTable->update($data, $where);
//send notification
if ($idea || $comment) {
$notifyApi = Engine_Api::_()->getDbtable('notifications', 'activity');
$notifyApi->addNotification($user, $user, $user, 'ynfeedback_idea_signupmerge', array('params' => array('route' => 'ynfeedback_general', 'action' => 'manage'), 'innerHTML' => ''));
}
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:29,代码来源:Core.php
示例6: ynfeed
public function ynfeed(Activity_Model_Action $action = null, array $data = array(), $method = null, $show_all_comments = false)
{
if (null === $action) {
return '';
}
$activity_moderate = "";
$viewer = Engine_Api::_()->user()->getViewer();
if ($viewer->getIdentity()) {
$activity_moderate = Engine_Api::_()->getDbtable('permissions', 'authorization')->getAllowed('user', $viewer->level_id, 'activity');
}
$form = new Activity_Form_Comment();
$data = array_merge($data, array('actions' => array($action), 'commentForm' => $form, 'user_limit' => Engine_Api::_()->getApi('settings', 'core')->getSetting('activity_userlength'), 'allow_delete' => Engine_Api::_()->getApi('settings', 'core')->getSetting('activity_userdelete'), 'activity_moderate' => $activity_moderate, 'viewAllComments' => isset($data['viewAllComments']) && $data['viewAllComments'] ? $data['viewAllComments'] : $show_all_comments, 'allowSaveFeed' => Engine_Api::_()->getApi('settings', 'core')->getSetting('ynfeed_savefeed', true), 'onlyactivity' => 1));
if (Engine_Api::_()->ynfeed()->checkEnabledAdvancedComment()) {
$data = array_merge($data, array('replyForm' => new Yncomment_Form_Reply()));
if ($method == 'update') {
if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('activity.commentreverseorder', false)) {
return $this->view->partial('_yncomment_activityComments.tpl', 'yncomment', $data);
} else {
return $this->view->partial('_yncomment_activityComments_reverse_chronological.tpl', 'yncomment', $data);
}
} else {
if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('activity.commentreverseorder', false)) {
return $this->view->partial('_yncomment_activityText.tpl', 'yncomment', $data);
} else {
return $this->view->partial('_yncomment_activityText_reverse_chronological.tpl', 'yncomment', $data);
}
}
} else {
if ($method == 'update') {
return $this->view->partial('_activityComments.tpl', 'activity', $data);
} else {
return $this->view->partial('_activityText.tpl', 'ynfeed', $data);
}
}
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:35,代码来源:Ynfeed.php
示例7: init
public function init()
{
$description = $this->getTranslator()->translate('Conrols settings about access to the admin panel. <br>');
$settings = Engine_Api::_()->getApi('settings', 'core');
if ($settings->getSetting('user.support.links', 0) == 1) {
$moreinfo = $this->getTranslator()->translate('More Info: <a href="%1$s" target="_blank"> KB Article</a>');
} else {
$moreinfo = $this->getTranslator()->translate('');
}
$description = vsprintf($description . $moreinfo, array('http://support.socialengine.com/questions/170/Admin-Panel-Settings-Admin-Password'));
// Decorators
$this->loadDefaultDecorators();
$this->getDecorator('Description')->setOption('escape', false);
$this->setTitle('Admin Reauthentication')->setDescription($description);
// Mode
$this->addElement('Radio', 'mode', array('multiOptions' => array('none' => 'Do not require reauthentication.', 'user' => 'Require admins to re-enter their password when they try to access the admin panel.', 'global' => 'Require admins to enter a global password when they try to access the admin panel.')));
// Password
$this->addElement('Password', 'password', array('label' => 'Password', 'description' => 'The password for "Require admins to enter a global password when they try to access the admin panel." above (otherwise ignore).'));
// Password confirm
$this->addElement('Password', 'password_confirm', array('label' => 'Password Again', 'description' => 'Confirm password'));
// timeout
$this->addElement('Text', 'timeout', array('label' => 'Timeout', 'description' => 'How long (in seconds) before admins have to reauthenticate?', 'required' => true, 'allowEmpty' => false, 'validators' => array(array('NotEmpty', true), array('Int', true), array('Between', true, array(300, 86400)))));
// init submit
$this->addElement('Button', 'submit', array('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true));
}
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:25,代码来源:Password.php
示例8: init
public function init()
{
$arrPhotoIds = array();
foreach ($this->_data as $data) {
if (!empty($data['photo_id'])) {
$arrPhotoIds[$data['user_id']] = $data['photo_id'];
}
}
$fileTbl = Engine_Api::_()->getItemTable('storage_file');
$files = $fileTbl->getMultiFiles($arrPhotoIds);
if (!empty($files)) {
$urls = array();
foreach ($files as $file) {
if (!array_key_exists($file->getIdentity(), $urls)) {
$url = array();
} else {
$url = $urls[$file->parent_file_id];
}
$url = $file->map();
if (empty($urls[$file->parent_file_id])) {
$urls[$file->parent_file_id] = array();
}
$urls[$file->parent_file_id][$file->type] = $url;
}
foreach ($this->_data as $index => $data) {
if (!empty($data['photo_id']) && isset($urls[$data['photo_id']])) {
$this->_data[$index]['photo_url'] = $urls[$data['photo_id']];
}
}
}
}
开发者ID:HiLeo1610,项目名称:tumlumsach,代码行数:31,代码来源:Item.php
示例9: checkRequire
public function checkRequire()
{
try {
$subject = Engine_Api::_()->core()->getSubject();
} catch (Exception $e) {
$subject = null;
}
$actionName = $this->getFrontController()->getRequest()->getActionName();
$ret = true;
if (!$subject instanceof Core_Model_Item_Abstract || !$subject->getIdentity()) {
$ret = false;
} else {
if (null !== $this->_requiredType && $subject->getType() != $this->_requiredType) {
$ret = false;
} else {
if (null !== ($requireType = $this->getActionRequireType($actionName)) && $subject->getType() != $requireType) {
$ret = false;
}
}
}
if (!$ret && APPLICATION_ENV == 'development' && Zend_Registry::isRegistered('Zend_Log') && ($log = Zend_Registry::get('Zend_Log')) instanceof Zend_Log) {
$target = $this->getRequest()->getModuleName() . '.' . $this->getRequest()->getControllerName() . '.' . $this->getRequest()->getActionName();
$log->log('Require class ' . get_class($this) . ' failed check for: ' . $target, Zend_Log::DEBUG);
}
return $ret;
}
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:26,代码来源:RequireSubject.php
示例10: indexAction
public function indexAction()
{
// Should we consider creation or modified recent?
$recentType = $this->_getParam('recentType', 'creation');
if (!in_array($recentType, array('creation', 'modified'))) {
$recentType = 'creation';
}
$this->view->recentType = $recentType;
$this->view->recentCol = $recentCol = $recentType . '_date';
// Get paginator
$table = Engine_Api::_()->getItemTable('video');
$select = $table->select()->where('search = ?', 1)->where('status = ?', 1);
if ($recentType == 'creation') {
// using primary should be much faster, so use that for creation
$select->order('video_id DESC');
} else {
$select->order($recentCol . ' DESC');
}
$this->view->paginator = $paginator = Zend_Paginator::factory($select);
// Set item count per page and current page number
$paginator->setItemCountPerPage($this->_getParam('itemCountPerPage', 4));
$paginator->setCurrentPageNumber($this->_getParam('page', 1));
// Hide if nothing to show
if ($paginator->getTotalItemCount() <= 0) {
return $this->setNoRender();
}
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:27,代码来源:Controller.php
示例11: indexAction
public function indexAction()
{
$table = Engine_Api::_()->getItemTable('ynfeedback_idea');
$select = $table->getIdeasSelect(array('orderby' => 'vote_count', 'direction' => 'DESC'));
$select->limit(Engine_Api::_()->getApi('settings', 'core')->getSetting('ynfeedback_max_idea', 20));
$this->view->ideas = $table->fetchAll($select);
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:7,代码来源:Controller.php
示例12: onMenuInitialize_UserProfileMessage
public function onMenuInitialize_UserProfileMessage($row)
{
// Not logged in
$viewer = Engine_Api::_()->user()->getViewer();
$subject = Engine_Api::_()->core()->getSubject();
if (!$viewer->getIdentity() || $viewer->getGuid(false) === $subject->getGuid(false)) {
return false;
}
// Get setting?
$permission = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'messages', 'create');
if (Authorization_Api_Core::LEVEL_DISALLOW === $permission) {
return false;
}
$messageAuth = Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'messages', 'auth');
if ($messageAuth == 'none') {
return false;
} else {
if ($messageAuth == 'friends') {
// Get data
$direction = (int) Engine_Api::_()->getApi('settings', 'core')->getSetting('user.friends.direction', 1);
if (!$direction) {
//one way
$friendship_status = $viewer->membership()->getRow($subject);
} else {
$friendship_status = $subject->membership()->getRow($viewer);
}
if (!$friendship_status || $friendship_status->active == 0) {
return false;
}
}
}
return array('label' => "Send Message", 'icon' => 'application/modules/Messages/externals/images/send.png', 'route' => 'messages_general', 'params' => array('action' => 'compose', 'to' => $subject->getIdentity()));
}
开发者ID:HiLeo1610,项目名称:tumlumsach,代码行数:33,代码来源:Menus.php
示例13: editAction
public function editAction()
{
// In smoothbox
$this->_helper->layout->setLayout('admin-simple');
// Must have an id
if (!($id = $this->_getParam('id'))) {
die('No identifier specified');
}
$typeTable = Engine_Api::_()->getDbtable('languages', 'user');
$type = $typeTable->find($id)->current();
$form = $this->view->form = new User_Form_Admin_Language_Add();
$form->setAction($this->getFrontController()->getRouter()->assemble(array()));
$form->setField($type);
// Check post
if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {
// Ok, we're good to add field
$values = $form->getValues();
$db = Engine_Db_Table::getDefaultAdapter();
$db->beginTransaction();
try {
$type->title = $values["label"];
$type->save();
$db->commit();
} catch (Exception $e) {
$db->rollBack();
throw $e;
}
return $this->_forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array('')));
}
// Output
$this->renderScript('admin-languages/form.tpl');
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:32,代码来源:AdminLanguagesController.php
示例14: indexAction
public function indexAction()
{
$tag_table = Engine_Api::_()->getDbtable('tags', 'core');
$tag_map_table = Engine_Api::_()->getDbtable('tagMaps', 'core');
$event_table = Engine_Api::_()->getItemTable('event');
$tag_name = $tag_table->info('name');
$tag_map_name = $tag_map_table->info('name');
$event_name = $event_table->info('name');
$filter_select = $tag_map_table->select()->distinct()->from($tag_map_name, array("{$event_name}.repeat_group", "{$tag_map_name}.tag_id", "{$tag_map_name}.resource_type"))->setIntegrityCheck(false)->joinLeft($event_name, "{$event_name}.event_id = {$tag_map_name}.resource_id", '')->where("{$event_name}.search = ?", "1");
$select = $tag_table->select()->from($tag_name, array("{$tag_name}.*", "Count({$tag_name}.tag_id) as count"));
$select->joinLeft($filter_select, "t.tag_id = {$tag_name}.tag_id", '');
$select->order("count DESC");
$select->group("{$tag_name}.text");
$select->where("t.resource_type = ?", "event");
if (Engine_Api::_()->core()->hasSubject('user')) {
$user = Engine_Api::_()->core()->getSubject('user');
$select->where("t.tagger_id = ?", $user->getIdentity());
} else {
if (Engine_Api::_()->core()->hasSubject('event')) {
$event = Engine_Api::_()->core()->getSubject('event');
$user = $event->getOwner();
$select->where("t.tagger_id = ?", $user->getIdentity());
}
}
$this->view->tags = $tag_table->fetchAll($select);
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:26,代码来源:Controller.php
示例15: getTable
public function getTable()
{
if (is_null($this->_table)) {
$this->_table = Engine_Api::_()->getDbtable('ratings', 'video');
}
return $this->_table;
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:7,代码来源:Rating.php
示例16: adminFieldOption
public function adminFieldOption($option, $map)
{
$parentField = Engine_Api::_()->fields()->getFieldsMeta($option->getFieldType())->getRowMatching('field_id', $option->field_id);
$parentFieldLabel = $parentField->label;
$optionId = $option->option_id;
$optionLabel = $this->view->translate($option->label);
$key = $map->getKey();
$translate = Zend_Registry::get('Zend_Translate');
$translate_extra_questions = $this->view->translate('These extra questions appear when "%1$s" is selected for "%2$s".', array($optionLabel, $parentFieldLabel));
$depWrapperClass = 'admin_field_dependent_field_wrapper ' . 'admin_field_dependent_field_wrapper_' . $optionId . ' ' . $this->_generateClassNames($key, 'admin_field_dependent_field_wrapper_');
$content = <<<EOF
<div class="{$depWrapperClass}" id="admin_field_dependent_field_wrapper_{$key}_{$optionId}">
<span class="field_extraoptions_explain">
{$translate_extra_questions}
<span>
[ <a class="dep_add_field_link" href="javascript:void(0);">{$translate->_("add question")}</a> ]
[ <a class="dep_hide_field_link" href="javascript:void(0);" onclick="void(0);" onmousedown="void(0);">{$translate->_("hide questions")}</a> ]
</span>
</span>
EOF;
$dependentMaps = Engine_Api::_()->fields()->getFieldsMaps($option->getFieldType())->getRowsMatching('option_id', $option->option_id);
//if( !empty($dependentFields) ) {
$content .= '<ul class="admin_fields">';
foreach ($dependentMaps as $map) {
$content .= $this->view->adminFieldMeta($map);
}
$content .= '</ul>';
//}
$content .= "</div>";
return $content;
}
开发者ID:robeendey,项目名称:ce,代码行数:32,代码来源:AdminFieldOption.php
示例17: indexAction
public function indexAction()
{
parent::indexAction();
$this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('profilecompleteness_admin_main', array(), 'profilecompleteness_admin_main_manage');
$type_id = 1;
$option_id = $this->_getParam('option_id');
if (empty($option_id)) {
$option_id = 1;
}
$this->view->option_id = $option_id;
$table = new ProfileCompleteness_Model_DbTable_Weights();
$db = $table->getAdapter();
$select = $table->select()->setIntegrityCheck(false);
$maptable = $db->select()->from(array('map' => 'engine4_user_fields_maps'))->from(array('meta' => 'engine4_user_fields_meta'), array())->where("map.child_id = meta.field_id AND meta.TYPE != 'heading'")->where('map.field_id=?', $type_id)->where('map.option_id = ?', $option_id);
$result = $db->select()->from(array('m' => $maptable), array('m.option_id', 'm.child_id'))->joinleft(array('w' => 'engine4_profilecompleteness_weights'), 'm.`child_id` = w.`field_id`', array('w.field_id'))->where('w.field_id IS NULL');
$select->from(array('r' => $result));
$rows = $table->fetchAll($select);
if (count($rows) != 0) {
$db = $table->getAdapter();
$db->beginTransaction();
foreach ($rows as $row) {
$values = array('field_id' => $row->child_id, 'weight' => 1, 'type_id' => $row->option_id);
$row = $table->createRow();
$row->setFromArray($values);
$row->save();
}
$db->commit();
}
$this->view->type = $option_id;
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:30,代码来源:AdminManageController.php
示例18: init
public function init()
{
$this->clearDecorators()->addDecorator('FormElements')->addDecorator('Form')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'search'))->addDecorator('HtmlTag2', array('tag' => 'div', 'class' => 'clear'));
$this->setAttribs(array('id' => 'filter_form', 'class' => 'global_form_box'));
$username = new Zend_Form_Element_Text('username');
$username->setLabel('Username')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'));
$levelMultiOptions = array(0 => ' ');
/* $table = $this->_helper->api()->getItemTable('user');
$select = $viewer->membership()->getMembersSelect('user_id');
$friends = $table->fetchAll($select);*/
$levels = Engine_Api::_()->getDbtable('levels', 'authorization')->fetchAll();
foreach ($levels as $row) {
$levelMultiOptions[$row->level_id] = $row->getTitle();
}
$level_id = new Zend_Form_Element_Select('level_id');
$level_id->setLabel('Level')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions($levelMultiOptions);
$enabled = new Zend_Form_Element_Select('enabled');
$enabled->setLabel('Approved')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('Label', array('tag' => null, 'placement' => 'PREPEND'))->addDecorator('HtmlTag', array('tag' => 'div'))->setMultiOptions(array('-1' => '', '0' => 'Not Approved', '1' => 'Approved'))->setValue('-1');
$submit = new Zend_Form_Element_Button('search', array('type' => 'submit'));
$submit->setLabel('Search')->clearDecorators()->addDecorator('ViewHelper')->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'buttons'))->addDecorator('HtmlTag2', array('tag' => 'div'));
$this->addElement('Hidden', 'order', array('order' => 10001));
$this->addElement('Hidden', 'order_direction', array('order' => 10002));
$this->addElements(array($username, $email, $level_id, $enabled, $submit));
// Set default action
$this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));
}
开发者ID:robeendey,项目名称:ce,代码行数:28,代码来源:Filter.php
示例19: denyAction
public function denyAction()
{
// In smoothbox
$this->_helper->layout->setLayout('admin-simple');
$request = Engine_Api::_()->getItem('advgroup_request', $this->_getParam('req_id'));
$id = $this->_getParam('id');
$this->view->group_id = $id;
// Check post
if ($this->getRequest()->isPost()) {
$db = Engine_Db_Table::getDefaultAdapter();
$db->beginTransaction();
try {
$group = Engine_Api::_()->getItem('group', $id);
if ($group) {
$group->requested = false;
$group->save();
}
if ($request) {
$request->status = 2;
$request->save();
}
$db->commit();
} catch (Exception $e) {
$db->rollBack();
throw $e;
}
$notifyApi = Engine_Api::_()->getDbtable('notifications', 'activity');
$notifyApi->addNotification($group->getOwner(), $group, $group, 'advgroup_request_denied');
$this->_forward('success', 'utility', 'core', array('smoothboxClose' => 10, 'parentRefresh' => 10, 'messages' => array('')));
}
// Output
$this->renderScript('admin-request/deny.tpl');
}
开发者ID:hoalangoc,项目名称:ftf,代码行数:33,代码来源:AdminRequestController.php
示例20: indexAction
public function indexAction()
{
$viewer = Engine_Api::_()->user()->getViewer();
if (empty($viewer)) {
return $this->setNoRender();
}
}
开发者ID:HiLeo1610,项目名称:tumlumsach,代码行数:7,代码来源:Controller.php
注:本文中的Engine_Api类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论