Skip to content

Instantly share code, notes, and snippets.

@codev0
Created June 22, 2016 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codev0/871cb12399d15ff78f2f999ad570d341 to your computer and use it in GitHub Desktop.
Save codev0/871cb12399d15ff78f2f999ad570d341 to your computer and use it in GitHub Desktop.
<?php
$plugin = array(
'name' => 'how',
'info' => 'Как мы работаем',
'view' => 'ucmas_blocks_how_view',
'configure' => 'ucmas_blocks_how_configure',
'save' => 'ucmas_blocks_how_save',
'is_visible' => 'ucmas_is_companion_theme_displayed',
);
function ucmas_blocks_how_view() {
$items = array();
foreach (variable_get('ucmas_blocks_how_texts', _ucmas_block_how_defaults()) as $text) {
$items[] = filter_xss_admin($text);
}
return array(
'subject' => 'Как мы работаем',
'content' => array(
'#theme' => 'item_list',
'#items' => $items,
),
);
}
function ucmas_blocks_how_configure() {
return ucmas_text_block_configure_form(
variable_get('ucmas_blocks_how_texts', _ucmas_block_how_defaults())
);
}
function ucmas_blocks_how_save($edit) {
variable_set('ucmas_blocks_how_texts', $edit['texts']);
}
function _ucmas_block_how_defaults() {
return array(
'Оставить заявку на сайте или по телефону',
'Проводим ознакомительное занятие',
'Определяем соответствующую группу',
'Заключаем договор',
'Приступаем к обучению',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment