本文整理汇总了PHP中LangLoader::get_message方法的典型用法代码示例。如果您正苦于以下问题:PHP LangLoader::get_message方法的具体用法?PHP LangLoader::get_message怎么用?PHP LangLoader::get_message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LangLoader
的用法示例。
在下文中一共展示了LangLoader::get_message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($content)
{
$template = new FileTemplate('admin/frame.tpl');
$customization_config = CustomizationConfig::load();
$template->put_all(array('C_FAVICON' => $customization_config->favicon_exists(), 'C_CSS_CACHE_ENABLED' => CSSCacheConfig::load()->is_enabled(), 'FAVICON' => Url::to_rel($customization_config->get_favicon_path()), 'FAVICON_TYPE' => $customization_config->favicon_type(), 'TITLE' => $this->get_seo_meta_data()->get_full_title(), 'MODULES_CSS' => $this->get_modules_css_files_html_code(), 'JS_TOP' => new FileTemplate('js_top.tpl'), 'JS_BOTTOM' => new FileTemplate('js_bottom.tpl'), 'L_XML_LANGUAGE' => LangLoader::get_message('xml_lang', 'main'), 'BODY' => new StringTemplate($content)));
$template->display();
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->set_disable_fields_configuration(array('regex', 'possible_values', 'default_value'));
$this->set_name(LangLoader::get_message('extended_fields.newsletter.name', 'common', 'newsletter'));
$this->field_used_once = true;
}
示例3: execute
public function execute(HTTPRequestCustom $request)
{
$id = $request->get_int('id', 0);
$id_stream = $request->get_int('id_stream', 0);
$db_querier = PersistenceContext::get_querier();
if ($this->subscriber_exist($id) || $id_stream !== 0 && $id !== 0) {
if (!NewsletterAuthorizationsService::id_stream($id_stream)->moderation_subscribers()) {
NewsletterAuthorizationsService::get_errors()->moderation_subscribers();
}
$condition = "WHERE subscriber_id = :id AND stream_id = :id_stream";
$parameters = array('id' => $id, 'id_stream' => $id_stream);
$db_querier->delete(NewsletterSetup::$newsletter_table_subscriptions, $condition, $parameters);
$condition = "WHERE subscriber_id = :id";
$parameters = array('id' => $id);
$is_last = PersistenceContext::get_querier()->count(NewsletterSetup::$newsletter_table_subscriptions, $condition, $parameters) == 0;
if ($is_last) {
$condition = "WHERE id = :id";
$parameters = array('id' => $id);
$db_querier->delete(NewsletterSetup::$newsletter_table_subscribers, $condition, $parameters);
}
NewsletterStreamsCache::invalidate();
$controller = new UserErrorController(LangLoader::get_message('success', 'status-messages-common'), LangLoader::get_message('process.success', 'status-messages-common'), UserErrorController::SUCCESS);
DispatchManager::redirect($controller);
} else {
$controller = new UserErrorController(LangLoader::get_message('error', 'status-messages-common'), LangLoader::get_message('error-subscriber-not-existed', 'common', 'newsletter'));
DispatchManager::redirect($controller);
}
}
示例4: __construct
public function __construct($value = '')
{
if (empty($value)) {
$value = LangLoader::get_message('submit', 'main');
}
parent::__construct($value, 'submit');
}
示例5: build_table
private function build_table()
{
$table = new SQLHTMLTableModel(DB_TABLE_MEMBER, __CLASS__, array(new HTMLTableColumn('pseudo', 'display_name'), new HTMLTableColumn('email'), new HTMLTableColumn('inscrit le', 'registration_date'), new HTMLTableColumn('messages'), new HTMLTableColumn('derniere connexion'), new HTMLTableColumn('messagerie')), new HTMLTableSortingRule('user_id', HTMLTableSortingRule::ASC));
$table->set_caption('Liste des membres');
$options = array('horn' => 'Horn', 'coucou' => 'Coucou', 'teston' => 'teston');
$table->add_filter(new HTMLTableEqualsFromListSQLFilter('display_name', 'filter1', 'login Equals', $options));
$table->add_filter(new HTMLTableBeginsWithTextSQLFilter('display_name', 'filter2', 'login Begins with (regex)', '`^(?!%).+$`'));
$table->add_filter(new HTMLTableBeginsWithTextSQLFilter('display_name', 'filter3', 'login Begins with (no regex)'));
$table->add_filter(new HTMLTableEndsWithTextSQLFilter('display_name', 'filter4', 'login Ends with (regex)', '`^(?!%).+$`'));
$table->add_filter(new HTMLTableEndsWithTextSQLFilter('display_name', 'filter5', 'login Ends with (no regex)'));
$table->add_filter(new HTMLTableLikeTextSQLFilter('display_name', 'filter6', 'login Like (regex)', '`^toto`'));
$table->add_filter(new HTMLTableLikeTextSQLFilter('display_name', 'filter7', 'login Like (no regex)'));
$table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter8', 'id >'));
$table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter9', 'id > (lower=3)', 3));
$table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter10', 'id > (upper=3)', HTMLTableNumberComparatorSQLFilter::NOT_BOUNDED, 3));
$table->add_filter(new HTMLTableGreaterThanSQLFilter('user_id', 'filter11', 'id > (lower=1, upper=3)', 1, 3));
$table->add_filter(new HTMLTableLessThanSQLFilter('user_id', 'filter12', 'id <'));
$table->add_filter(new HTMLTableGreaterThanOrEqualsToSQLFilter('user_id', 'filter13', 'id >='));
$table->add_filter(new HTMLTableLessThanOrEqualsToSQLFilter('user_id', 'filter14', 'id <='));
$table->add_filter(new HTMLTableEqualsToSQLFilter('user_id', 'filter15', 'id ='));
$html_table = new HTMLTable($table);
$results = array();
$result = $table->get_sql_results();
foreach ($result as $row) {
$results[] = new HTMLTableRow(array(new HTMLTableRowCell($row['display_name']), new HTMLTableRowCell($row['show_email'] == 1 ? '<a href="mailto:' . $row['email'] . '" class="basic-button smaller">Mail</a>' : ' '), new HTMLTableRowCell(Date::to_format($row['registration_date'], Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell(!empty($row['posted_msg']) ? $row['posted_msg'] : '0'), new HTMLTableRowCell(!empty($row['last_connection_date']) ? Date::to_format($row['last_connection_date'], Date::FORMAT_DAY_MONTH_YEAR) : LangLoader::get_message('never', 'main')), new HTMLTableRowCell('<a href="' . Url::to_rel('/user/pm.php?pm=' . $row['user_id']) . '" class="basic-button smaller">MP</a>')));
}
$html_table->set_rows($table->get_number_of_matching_rows(), $results);
return $html_table;
}
示例6: build_form
private function build_form()
{
$form = new HTMLForm(__CLASS__);
//Configuration
$fieldset = new FormFieldsetHTML('configuration_fieldset', LangLoader::get_message('configuration', 'admin-common'));
$form->add_fieldset($fieldset);
$fieldset->add_field(new FormFieldNumberEditor('items_number_per_page', $this->lang['calendar.config.items_number_per_page'], $this->config->get_items_number_per_page(), array('min' => 1, 'max' => 50, 'required' => true), array(new FormFieldConstraintIntegerRange(1, 50))));
$fieldset->add_field(new FormFieldCheckbox('comments_enabled', LangLoader::get_message('config.comments_enabled', 'admin-common'), $this->config->are_comments_enabled()));
$fieldset->add_field(new FormFieldColorPicker('event_color', $this->lang['calendar.config.event_color'], $this->config->get_event_color(), array(), array(new FormFieldConstraintRegex('`^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$`i'))));
$fieldset->add_field(new FormFieldCheckbox('members_birthday_enabled', $this->lang['calendar.config.members_birthday_enabled'], $this->config->is_members_birthday_enabled(), array('events' => array('click' => '
if (HTMLForms.getField("members_birthday_enabled").getValue()) {
HTMLForms.getField("birthday_color").enable();
} else {
HTMLForms.getField("birthday_color").disable();
}'))));
$user_born_field = ExtendedFieldsCache::load()->get_extended_field_by_field_name('user_born');
if (!empty($user_born_field) && !$user_born_field['display']) {
$fieldset->add_field(new FormFieldHTML('user_born_disabled_msg', MessageHelper::display($this->lang['calendar.error.e_user_born_field_disabled'], MessageHelper::WARNING)->render()));
}
$fieldset->add_field(new FormFieldColorPicker('birthday_color', $this->lang['calendar.config.birthday_color'], $this->config->get_birthday_color(), array('hidden' => !$this->config->is_members_birthday_enabled()), array(new FormFieldConstraintRegex('`^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$`i'))));
$common_lang = LangLoader::get('common');
$fieldset = new FormFieldsetHTML('authorizations_fieldset', $common_lang['authorizations'], array('description' => LangLoader::get_message('config.authorizations.explain', 'admin-common')));
$form->add_fieldset($fieldset);
$auth_settings = new AuthorizationsSettings(array(new ActionAuthorization($common_lang['authorizations.read'], Category::READ_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.write'], Category::WRITE_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.contribution'], Category::CONTRIBUTION_AUTHORIZATIONS), new ActionAuthorization($common_lang['authorizations.moderation'], Category::MODERATION_AUTHORIZATIONS)));
$auth_setter = new FormFieldAuthorizationsSetter('authorizations', $auth_settings);
$auth_settings->build_from_auth_array($this->config->get_authorizations());
$fieldset->add_field($auth_setter);
//Submit and reset buttons
$this->submit_button = new FormButtonDefaultSubmit();
$form->add_button($this->submit_button);
$form->add_button(new FormButtonReset());
$this->form = $form;
}
示例7: update_fields
private function update_fields(HTTPRequestCustom $request)
{
if ($request->get_value('submit', false)) {
$this->update_position($request);
$this->view->put('MSG', MessageHelper::display(LangLoader::get_message('message.success.position.update', 'status-messages-common'), MessageHelper::SUCCESS, 5));
}
}
示例8: execute
public function execute(HTTPRequestCustom $request)
{
$this->load_lang();
$this->load_config();
$theme = $request->get_value('theme', 'all');
if ($theme !== 'all' && !ThemesManager::get_theme_existed($theme)) {
AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
}
$this->build_form($theme);
$tpl = new StringTemplate('# INCLUDE MSG # # INCLUDE FORM #');
$tpl->add_lang($this->lang);
if ($this->submit_button->has_been_submited() && $this->form->validate()) {
$header_logo = $this->form->get_value('header_logo', null);
if ($header_logo !== null) {
$file_type = new FileType(new File($header_logo->get_name()));
if ($file_type->is_picture()) {
$this->save($header_logo, $theme);
AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
} else {
$tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
}
} elseif ($this->form->get_value('use_default_logo')) {
$this->delete_pictures_saved($theme);
AppContext::get_response()->redirect(AdminCustomizeUrlBuilder::customize_interface());
} else {
$tpl->put('MSG', MessageHelper::display(LangLoader::get_message('process.error', 'status-messages-common'), MessageHelper::ERROR, 4));
}
}
$tpl->put('FORM', $this->form->display());
return new AdminCustomizationDisplayResponse($tpl, $this->lang['customization.interface']);
}
示例9: build_table
private function build_table()
{
$table_model = new SQLHTMLTableModel(DownloadSetup::$download_table, 'table', array(new HTMLTableColumn(LangLoader::get_message('form.name', 'common'), 'name'), new HTMLTableColumn(LangLoader::get_message('category', 'categories-common'), 'id_category'), new HTMLTableColumn(LangLoader::get_message('author', 'common'), 'display_name'), new HTMLTableColumn(LangLoader::get_message('form.date.creation', 'common'), 'creation_date'), new HTMLTableColumn(LangLoader::get_message('status', 'common'), 'approbation_type'), new HTMLTableColumn('')), new HTMLTableSortingRule('creation_date', HTMLTableSortingRule::DESC));
$table = new HTMLTable($table_model);
$table_model->set_caption($this->lang['download.management']);
$results = array();
$result = $table_model->get_sql_results('download
LEFT JOIN ' . DB_TABLE_COMMENTS_TOPIC . ' com ON com.id_in_module = download.id AND com.module_id = \'download\'
LEFT JOIN ' . DB_TABLE_AVERAGE_NOTES . ' notes ON notes.id_in_module = download.id AND notes.module_name = \'download\'
LEFT JOIN ' . DB_TABLE_NOTE . ' note ON note.id_in_module = download.id AND note.module_name = \'download\' AND note.user_id = ' . AppContext::get_current_user()->get_id() . '
LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = download.author_user_id', array('*', 'download.id'));
foreach ($result as $row) {
$downloadfile = new DownloadFile();
$downloadfile->set_properties($row);
$category = $downloadfile->get_category();
$user = $downloadfile->get_author_user();
$edit_link = new LinkHTMLElement(DownloadUrlBuilder::edit($downloadfile->get_id()), '', array('title' => LangLoader::get_message('edit', 'common')), 'fa fa-edit');
$delete_link = new LinkHTMLElement(DownloadUrlBuilder::delete($downloadfile->get_id()), '', array('title' => LangLoader::get_message('delete', 'common'), 'data-confirmation' => 'delete-element'), 'fa fa-delete');
$user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
$author = $user->get_id() !== User::VISITOR_LEVEL ? new LinkHTMLElement(UserUrlBuilder::profile($user->get_id()), $user->get_display_name(), !empty($user_group_color) ? array('style' => 'color: ' . $user_group_color) : array(), UserService::get_level_class($user->get_level())) : $user->get_display_name();
$results[] = new HTMLTableRow(array(new HTMLTableRowCell(new LinkHTMLElement(DownloadUrlBuilder::display($category->get_id(), $category->get_rewrited_name(), $downloadfile->get_id(), $downloadfile->get_rewrited_name()), $downloadfile->get_name()), 'left'), new HTMLTableRowCell(new LinkHTMLElement(DownloadUrlBuilder::display_category($category->get_id(), $category->get_rewrited_name()), $category->get_name())), new HTMLTableRowCell($author), new HTMLTableRowCell($downloadfile->get_creation_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell($downloadfile->get_status()), new HTMLTableRowCell($edit_link->display() . $delete_link->display())));
}
$table->set_rows($table_model->get_number_of_matching_rows(), $results);
$this->view->put('table', $table->display());
}
示例10: build_form
private function build_form(HTTPRequestCustom $request)
{
$security_config = SecurityConfig::load();
$form = new HTMLForm(__CLASS__);
$fieldset = new FormFieldsetHTML('add_member', LangLoader::get_message('members.add-member', 'admin-user-common'));
$form->add_fieldset($fieldset);
$fieldset->add_field(new FormFieldTextEditor('display_name', $this->lang['display_name'], '', array('maxlength' => 100, 'required' => true, 'events' => array('blur' => '
if (!HTMLForms.getField("login").getValue() && HTMLForms.getField("display_name").validate() == "") {
HTMLForms.getField("login").setValue(HTMLForms.getField("display_name").getValue().replace(/\\s/g, \'\'));
HTMLForms.getField("login").enableValidationMessage();
HTMLForms.getField("login").liveValidate();
}')), array(new FormFieldConstraintLengthRange(3, 100), new FormFieldConstraintDisplayNameExists())));
$fieldset->add_field($email = new FormFieldMailEditor('email', $this->lang['email'], '', array('required' => true), array(new FormFieldConstraintMailExist())));
$fieldset->add_field(new FormFieldCheckbox('custom_login', $this->lang['login.custom'], false, array('events' => array('click' => '
if (HTMLForms.getField("custom_login").getValue()) {
HTMLForms.getField("login").enable();
} else {
HTMLForms.getField("login").disable();
}'))));
$fieldset->add_field($login = new FormFieldTextEditor('login', $this->lang['login'], '', array('required' => true, 'hidden' => true, 'maxlength' => 25), array(new FormFieldConstraintLengthRange(3, 25), new FormFieldConstraintPHPBoostAuthLoginExists())));
$fieldset->add_field($password = new FormFieldPasswordEditor('password', $this->lang['password'], '', array('required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length()), new FormFieldConstraintPasswordStrength())));
$fieldset->add_field($password_bis = new FormFieldPasswordEditor('password_bis', $this->lang['password.confirm'], '', array('required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length()), new FormFieldConstraintPasswordStrength())));
$form->add_constraint(new FormConstraintFieldsEquality($password, $password_bis));
if ($security_config->are_login_and_email_forbidden_in_password()) {
$form->add_constraint(new FormConstraintFieldsInequality($email, $password));
$form->add_constraint(new FormConstraintFieldsInequality($login, $password));
}
$fieldset->add_field(new FormFieldRanksSelect('rank', $this->lang['rank'], FormFieldRanksSelect::MEMBER));
$fieldset->add_field(new FormFieldHidden('referrer', $request->get_url_referrer()));
$this->submit_button = new FormButtonDefaultSubmit();
$form->add_constraint(new FormConstraintFieldsEquality($password, $password_bis));
$form->add_button($this->submit_button);
$form->add_button(new FormButtonReset());
$this->form = $form;
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->lang = LangLoader::get('admin-user-common');
$this->set_disable_fields_configuration(array('possible_values'));
$this->set_name(LangLoader::get_message('type.short-text', 'admin-user-common'));
}
示例12: build_form
private function build_form()
{
$security_config = SecurityConfig::load();
$this->form = new HTMLForm('adminForm', '', false);
$fieldset = new FormFieldsetHTML('adminAccount', $this->lang['admin.account']);
$this->form->add_fieldset($fieldset);
$fieldset->add_field(new FormFieldTextEditor('display_name', LangLoader::get_message('display_name', 'user-common'), '', array('maxlength' => 100, 'required' => true, 'events' => array('blur' => '
if (!HTMLForms.getField("login").getValue() && HTMLForms.getField("display_name").validate() == "") {
HTMLForms.getField("login").setValue(HTMLForms.getField("display_name").getValue().replace(/\\s/g, \'\'));
HTMLForms.getField("login").enableValidationMessage();
HTMLForms.getField("login").liveValidate();
}')), array(new FormFieldConstraintLengthRange(3, 100, $this->lang['admin.login.length']))));
$fieldset->add_field(new FormFieldMailEditor('email', $this->lang['admin.email'], '', array('required' => true)));
$fieldset->add_field(new FormFieldCheckbox('custom_login', LangLoader::get_message('login.custom', 'user-common'), false, array('description' => LangLoader::get_message('login.custom.explain', 'user-common'), 'events' => array('click' => '
if (HTMLForms.getField("custom_login").getValue()) {
HTMLForms.getField("login").enable();
} else {
HTMLForms.getField("login").disable();
}'))));
$fieldset->add_field(new FormFieldTextEditor('login', LangLoader::get_message('login', 'user-common'), '', array('required' => true, 'hidden' => true, 'maxlength' => 25), array(new FormFieldConstraintLengthRange(3, 25), new FormFieldConstraintPHPBoostAuthLoginExists())));
$fieldset->add_field($password = new FormFieldPasswordEditor('password', $this->lang['admin.password'], '', array('description' => StringVars::replace_vars($this->lang['admin.password.explanation'], array('number' => $security_config->get_internal_password_min_length())), 'required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length(), StringVars::replace_vars($this->lang['admin.password.length'], array('number' => $security_config->get_internal_password_min_length()))), new FormFieldConstraintPasswordStrength())));
$fieldset->add_field($repeatPassword = new FormFieldPasswordEditor('repeatPassword', $this->lang['admin.password.repeat'], '', array('required' => true), array(new FormFieldConstraintLengthMin($security_config->get_internal_password_min_length()), new FormFieldConstraintPasswordStrength())));
$this->form->add_constraint(new FormConstraintFieldsEquality($password, $repeatPassword));
$fieldset->add_field(new FormFieldCheckbox('createSession', $this->lang['admin.connectAfterInstall'], true));
$fieldset->add_field(new FormFieldCheckbox('autoconnect', $this->lang['admin.autoconnect'], true));
$action_fieldset = new FormFieldsetSubmit('actions');
$back = new FormButtonLinkCssImg($this->lang['step.previous'], InstallUrlBuilder::website(), 'fa fa-arrow-left');
$action_fieldset->add_element($back);
$this->submit_button = new FormButtonSubmitCssImg($this->lang['step.next'], 'fa fa-arrow-right', 'admin');
$action_fieldset->add_element($this->submit_button);
$this->form->add_fieldset($action_fieldset);
}
示例13: display_profile_fields
/**
* @desc This function displayed fields profile
* @param object $member_extended_field MemberExtendedField containing user_id, Template and field_type.
*/
public static function display_profile_fields(HTMLForm $form, $user_id)
{
$extended_fields_displayed = PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST, 'WHERE display=1');
if ($extended_fields_displayed) {
$fieldset = new FormFieldsetHTML('other', LangLoader::get_message('other', 'main'));
$nbr_field = 0;
$result = PersistenceContext::get_querier()->select("SELECT exc.name, exc.description, exc.field_type, exc.required, exc.field_name, exc.possible_values, exc.default_value, exc.auth, exc.regex, ex.*\r\n\t\t\tFROM " . DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST . " exc\r\n\t\t\tLEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " ex ON ex.user_id = :user_id\r\n\t\t\tWHERE exc.display = 1\r\n\t\t\tORDER BY exc.position", array('user_id' => $user_id));
while ($extended_field = $result->fetch()) {
if (AppContext::get_current_user()->check_auth(unserialize($extended_field['auth']), ExtendedField::READ_PROFILE_AUTHORIZATION)) {
$value = !empty($extended_field[$extended_field['field_name']]) ? $extended_field[$extended_field['field_name']] : $extended_field['default_value'];
$extended_field['value'] = $value;
$member_extended_field = new MemberExtendedField();
$member_extended_field->set_user_id($user_id);
$member_extended_field->set_fieldset($fieldset);
$member_extended_field->set_properties($extended_field);
$member_extended_field->get_instance()->display_field_profile($member_extended_field);
$nbr_field++;
}
}
if ($nbr_field > 0) {
$form->add_fieldset($fieldset);
}
$result->dispose();
}
}
示例14: build_table
private function build_table()
{
$table_model = new SQLHTMLTableModel(CalendarSetup::$calendar_events_table, 'table', array(new HTMLTableColumn(LangLoader::get_message('form.title', 'common'), 'title'), new HTMLTableColumn(LangLoader::get_message('category', 'categories-common'), 'id_category'), new HTMLTableColumn(LangLoader::get_message('author', 'common'), 'display_name'), new HTMLTableColumn(LangLoader::get_message('date', 'date-common'), 'start_date'), new HTMLTableColumn($this->lang['calendar.titles.repetition']), new HTMLTableColumn(LangLoader::get_message('status.approved', 'common'), 'approved'), new HTMLTableColumn('')), new HTMLTableSortingRule('start_date', HTMLTableSortingRule::DESC));
$table = new HTMLTable($table_model);
$table_model->set_caption($this->lang['calendar.config.events.management']);
$table_model->add_permanent_filter('parent_id = 0');
$results = array();
$result = $table_model->get_sql_results('event
LEFT JOIN ' . CalendarSetup::$calendar_events_content_table . ' event_content ON event_content.id = event.content_id
LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = event_content.author_id');
foreach ($result as $row) {
$event = new CalendarEvent();
$event->set_properties($row);
$category = $event->get_content()->get_category();
$user = $event->get_content()->get_author_user();
$edit_link = new LinkHTMLElement(CalendarUrlBuilder::edit_event(!$event->get_parent_id() ? $event->get_id() : $event->get_parent_id()), '', array('title' => LangLoader::get_message('edit', 'common')), 'fa fa-edit');
$delete_link = new LinkHTMLElement(CalendarUrlBuilder::delete_event($event->get_id()), '', array('title' => LangLoader::get_message('delete', 'common'), 'data-confirmation' => !$event->belongs_to_a_serie() ? 'delete-element' : ''), 'fa fa-delete');
$user_group_color = User::get_group_color($user->get_groups(), $user->get_level(), true);
$author = $user->get_id() !== User::VISITOR_LEVEL ? new LinkHTMLElement(UserUrlBuilder::profile($user->get_id()), $user->get_display_name(), !empty($user_group_color) ? array('style' => 'color: ' . $user_group_color) : array(), UserService::get_level_class($user->get_level())) : $user->get_display_name();
$br = new BrHTMLElement();
$results[] = new HTMLTableRow(array(new HTMLTableRowCell(new LinkHTMLElement(CalendarUrlBuilder::display_event($category->get_id(), $category->get_rewrited_name(), $event->get_id(), $event->get_content()->get_rewrited_title()), $event->get_content()->get_title()), 'left'), new HTMLTableRowCell(new SpanHTMLElement($category->get_name(), array('style' => $category->get_id() != Category::ROOT_CATEGORY && $category->get_color() ? 'color:' . $category->get_color() : ''))), new HTMLTableRowCell($author), new HTMLTableRowCell(LangLoader::get_message('from_date', 'main') . ' ' . $event->get_start_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE) . $br->display() . LangLoader::get_message('to_date', 'main') . ' ' . $event->get_end_date()->format(Date::FORMAT_DAY_MONTH_YEAR_HOUR_MINUTE)), new HTMLTableRowCell($event->belongs_to_a_serie() ? $this->lang['calendar.labels.repeat.' . $event->get_content()->get_repeat_type()] . ' - ' . $event->get_content()->get_repeat_number() . ' ' . $this->lang['calendar.labels.repeat_times'] : LangLoader::get_message('no', 'common')), new HTMLTableRowCell($event->get_content()->is_approved() ? LangLoader::get_message('yes', 'common') : LangLoader::get_message('no', 'common')), new HTMLTableRowCell($edit_link->display() . $delete_link->display())));
}
$table->set_rows($table_model->get_number_of_matching_rows(), $results);
$this->view->put('table', $table->display());
}
示例15: get_root_category
public function get_root_category()
{
$root = new RichRootCategory();
$root->set_authorizations(NewsConfig::load()->get_authorizations());
$root->set_description(StringVars::replace_vars(LangLoader::get_message('news.seo.description.root', 'common', 'news'), array('site' => GeneralConfig::load()->get_site_name())));
return $root;
}