public function initialize() { if (class_exists('sfPlop')) { sfPlop::loadPlugin(array('slots' => array('GoogleMaps' => 'GoogleMaps map', 'GoogleMapsFilter' => 'GoogleMaps filter', 'GoogleMapsPosition' => 'GoogleMaps position'))); } sfConfig::set('sf_plop_googlemaps_zooms', array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)); }
public function configure() { $this->setWidgets(array('sf_plop_website_description' => new sfWidgetFormTextarea(array('default' => sfPlop::get('sf_plop_website_description'), 'label' => 'SEO description')), 'sf_plop_website_keywords' => new sfWidgetFormInputText(array('label' => 'SEO keywords'), array('value' => sfPlop::get('sf_plop_website_keywords'))), 'sf_plop_use_custom_page_title' => new sfWidgetFormInputCheckbox(array('label' => 'Use the website title in the page title ?'), array('checked' => sfPlop::get('sf_plop_use_custom_page_title') == true ? 'checked' : null)), 'sf_plop_website_title_position' => new sfWidgetFormSelect(array('choices' => array('before' => 'before', 'after' => 'after'), 'label' => 'Website title position'), array()), 'sf_plop_website_title' => new sfWidgetFormInputText(array('label' => 'Website title'), array('value' => sfPlop::get('sf_plop_website_title'))), 'sf_plop_website_title_prefix' => new sfWidgetFormInputText(array('label' => 'Website title prefix'), array('value' => sfPlop::get('sf_plop_website_title_prefix'))), 'sf_plop_website_title_suffix' => new sfWidgetFormInputText(array('label' => 'Website title suffix'), array('value' => sfPlop::get('sf_plop_website_title_suffix'))), 'sf_plop_use_title_in_seo_description' => new sfWidgetFormInputCheckbox(array('label' => 'Use the page title in the description ?'), array('checked' => sfPlop::get('sf_plop_use_title_in_seo_description') == true ? 'checked' : null)))); $this->setDefault('sf_plop_website_title_position', sfPlop::get('sf_plop_website_title_position')); $this->setValidators(array('sf_plop_website_description' => new sfValidatorString(array('required' => false)), 'sf_plop_website_keywords' => new sfValidatorString(array('required' => false)), 'sf_plop_use_custom_page_title' => new sfValidatorBoolean(array('required' => false)), 'sf_plop_website_title_position' => new sfValidatorPass(), 'sf_plop_website_title' => new sfValidatorString(array('required' => false)), 'sf_plop_website_title_prefix' => new sfValidatorString(array('required' => false)), 'sf_plop_website_title_suffix' => new sfValidatorString(array('required' => false)), 'sf_plop_use_title_in_seo_description' => new sfValidatorBoolean(array('required' => false)))); parent::configure(); }
public function configure() { parent::configure(); unset($this['value'], $this['options']); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); $this->widgetSchema->getFormFormatter()->setHelpFormat(sfPlop::get('sf_plop_form_help_format')); $helps = array(); $slotConfig = $this->getObject()->getsfPlopSlotConfig(); $slotConfig->setCulture($this->getObject()->getCulture()); $slotObject = $slotConfig->getSlot()->getTemplateObject(); if ($slotObject->isContentEditable() || $slotObject->isContentOptionable()) { $fields = $slotObject->getFields($slotConfig); foreach ($fields as $field_name => $field_widget) { $this->widgetSchema[$field_name] = $field_widget; if ($field_name == 'value' && $slotObject->isContentEditable() && $this->getOption('isAjax', false)) { $this->widgetSchema[$field_name]->setHidden(true); } if ($field_name == 'value') { $this->setDefault($field_name, $slotConfig->getValue($this->getOption('culture'))); } else { $this->setDefault($field_name, $slotConfig->getOption($field_name, $field_widget->getOption('default'), $this->getOption('culture'))); } } $this->widgetSchema->setHelps($slotObject->getFieldHelps($slotConfig)); foreach ($slotObject->getValidators($slotConfig) as $field_name => $field_validator) { $this->validatorSchema[$field_name] = $field_validator; } $this->validatorSchema->setPostValidator(new sfValidatorCallback(array('callback' => array($this, 'dumpOptions'), 'arguments' => array('slot_fields' => array_keys($fields))))); } }
public function configure() { parent::configure(); unset($this['tree_left'], $this['tree_right'], $this['tree_level'], $this['created_at'], $this['updated_at']); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); $this->validatorSchema->setOption('allow_extra_fields', true); $this->validatorSchema->setOption('filter_extra_fields', false); if ($this->isNew()) { if ($this->getOption('culture', sfPlop::get('sf_plop_default_culture'))) { $this->getObject()->setCulture($this->getOption('culture')); } $this->embedForm($this->getObject()->getCulture(), new sfPlopPageI18nForm($this->getObject()->getTranslation($this->getObject()->getCulture()), array('only_title' => true))); $this->widgetSchema->moveField($this->getObject()->getCulture(), sfWidgetFormSchema::FIRST); } $this->widgetSchema['theme'] = new sfWidgetFormPlopChoiceSubTheme(array('add_empty' => true)); $this->validatorSchema['theme'] = new sfvalidatorPlopChoiceSubTheme(array('required' => false)); $this->widgetSchema['is_published']->setLabel('Is published ?'); $this->widgetSchema['is_category']->setLabel('Is category ?'); $this->widgetSchema['icon'] = new sfWidgetFormAssetExtraChoice(array('label' => 'Icon')); $this->validatorSchema['icon'] = new sfValidatorString(array('required' => false)); $this->widgetSchema['template_id'] = new sfWidgetFormChoice(array('choices' => array('' => '') + $this->getTemplatePages())); $this->validatorSchema['template_id'] = new sfValidatorChoice(array('choices' => array_keys($this->getTemplatePages()), 'required' => false)); if (!$this->getObject()->isRoot()) { $this->widgetSchema['position'] = new sfWidgetFormChoice(array('choices' => $this->getPositions(), 'expanded' => true)); $this->validatorSchema['position'] = new sfValidatorChoice(array('choices' => array_keys($this->getPositions()), 'required' => false)); $this->widgetSchema['position_relative'] = new sfWidgetFormChoice(array('label' => 'Relative position to', 'choices' => array('' => '') + sfPlopPagePeer::getPagesWithLevel())); $this->validatorSchema['position_relative'] = new sfValidatorChoice(array('choices' => array_keys(sfPlopPagePeer::getPagesWithLevel()), 'required' => false)); } $this->validatorSchema->setPostValidator(new sfValidatorCallback(array('callback' => array($this, 'checkPositions')))); }
/** * Constructor. */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('culture', sfPlop::get('sf_plop_default_culture')); $this->addOption('url', '@sf_plop_ws_repository'); $this->addOption('query_string', array('folder=/assets', 'type=file')); }
function initialize() { parent::initialize(); if (class_exists('sfPlop')) { sfPlop::loadPlugin(array('modules' => array('sfAssetLibrary' => array('name' => 'Media library', 'route' => '@sf_asset_library_root'), 'sfAssetGallery' => array('name' => 'Media galleries', 'route' => '@sfAssetGallery')), 'slots' => array('Asset' => 'Asset', 'AssetGallery' => 'Asset gallery', 'CustomGalleryAsset' => 'Custom gallery asset', 'AssetGalleryNavigation' => 'Asset galleries list'))); } }
public function configure() { $this->setWidgets(array('sf_plop_use_statistics' => new sfWidgetFormInputCheckbox(array('label' => 'Use statistics ?'), array('checked' => sfPlop::get('sf_plop_use_statistics') == true ? 'checked' : null)), 'sf_plop_statistics_code' => new sfWidgetFormTextarea(array('default' => sfPlop::get('sf_plop_statistics_code'), 'label' => 'Statistics code')), 'sf_plop_statistics_reports_url' => new sfWidgetFormInputText(array('label' => 'Statistics reports url'), array('value' => sfPlop::get('sf_plop_statistics_reports_url'))))); $this->setDefault('sf_plop_statistics_code', sfPlop::get('sf_plop_statistics_code')); $this->setValidators(array('sf_plop_use_statistics' => new sfValidatorBoolean(), 'sf_plop_statistics_code' => new sfValidatorString(array('required' => false)), 'sf_plop_statistics_reports_url' => new sfValidatorUrl(array('required' => false)))); parent::configure(); }
function initialize() { parent::initialize(); if (class_exists('sfPlop')) { sfPlop::loadPlugin(array('modules' => array('sfGuardUser' => array('name' => 'Users', 'route' => '@sf_guard_user'), 'sfGuardGroup' => array('name' => 'Groups', 'route' => '@sf_guard_group')))); } }
protected function getParams($slot, $settings) { $page = $settings['page']; $relative_slug = $slot->getOption('relative_page', null, $settings['culture']); if ($relative_slug === null) { $relative_page = $page->isRoot() ? $page : sfPlopPageQuery::create()->findRoot(); } elseif ($page->getSlug() == $relative_slug) { $relative_page = $page; } else { $relative_page = sfPlopPagePeer::retrieveBySlug($relative_slug); } if (!$relative_page) { $relative_page = $page->isRoot() ? $page : sfPlopPageQuery::create()->findRoot(); } $level_depth = $slot->getOption('level_depth', null, $settings['culture']); if (isset($level_depth)) { $q = sfPlopPageQuery::create()->addCond('cond1', sfPlopPagePeer::TREE_LEVEL, $relative_page->getLevel() + $level_depth, Criteria::LESS_EQUAL)->addCond('cond2', sfPlopPagePeer::TREE_LEVEL, null, Criteria::ISNULL)->combine(array('cond1', 'cond2'), Criteria::LOGICAL_OR); } else { $q = sfPlopPageQuery::create(); } $level1_nodes = $relative_page->getDescendants($q); $useAjax = sfPlop::get('sf_plop_use_ajax') === true ? true : false; $displays = $slot->getOption('displays', array(), $settings['culture']); $use_icon = in_array('icon', $displays) ? true : false; $use_subtitle = in_array('subtitle', $displays) ? true : false; $use_title = in_array('title', $displays) || !$use_icon && !$use_subtitle ? true : false; return array('relative_level' => $relative_page->getLevel() + 1, 'relative_page' => $relative_page, 'level_depth' => $level_depth, 'show_hidden_parent' => false, 'level1_nodes' => $level1_nodes, 'useAjax' => $useAjax, 'displays' => $displays, 'use_icon' => $use_icon, 'use_subtitle' => $use_subtitle, 'use_title' => $use_title, 'menu_class' => 'w-menu'); }
public function configure() { $this->setWidgets(array('sf_plop_allow_registration' => new sfWidgetFormInputCheckbox(array('label' => 'Allow registration ?'), array('checked' => sfPlop::get('sf_plop_allow_registration') == true ? 'checked' : null)), 'sf_plop_private_access' => new sfWidgetFormInputCheckbox(array('label' => 'Restrict public access ?'), array('checked' => sfPlop::get('sf_plop_private_access') == true ? 'checked' : null)), 'sf_plop_cache_lifetime' => new sfWidgetFormChoice(array('label' => 'Cache lifetime', 'choices' => $this->getCacheLifetimeValues())))); $this->setValidators(array('sf_plop_allow_registration' => new sfValidatorBoolean(), 'sf_plop_private_access' => new sfValidatorBoolean(), 'sf_plop_cache_lifetime' => new sfValidatorChoice(array('choices' => array_keys($this->getCacheLifetimeValues()))))); $this->setDefault('sf_plop_cache_lifetime', sfPlop::get('sf_plop_cache_lifetime')); parent::configure(); }
public function configure() { parent::configure(); unset($this['created_at'], $this['updated_at']); foreach (sfPlop::get('sf_plop_cultures') as $culture) { $this->embedForm($culture, new sfPlopShopDurationI18nForm($this->getObject()->getTranslation($culture))); } }
public function configure() { parent::configure(); $selector = '#container .w-block'; $this->setWidgets(array('sf_plop_block_text_font' => new sfWidgetFormCssProperty(array('property' => 'font-family', 'label' => 'Font family'), array('value' => sfPlop::get('sf_plop_block_text_font'), 'title' => 'font-family', 'data-target' => $selector)), 'sf_plop_block_text_size' => new sfWidgetFormCssProperty(array('property' => 'font-size', 'label' => 'Font size'), array('value' => sfPlop::get('sf_plop_block_text_size'), 'title' => 'font-size', 'data-target' => $selector)), 'sf_plop_block_text_color' => new sfWidgetFormInputColor(array('label' => 'Text color'), array('value' => sfPlop::get('sf_plop_block_text_color'), 'title' => 'color', 'data-target' => $selector)), 'sf_plop_block_link_color' => new sfWidgetFormInputColor(array('label' => 'Link color'), array('value' => sfPlop::get('sf_plop_block_link_color'), 'title' => 'color', 'data-target' => $selector . ' a')), 'sf_plop_block_bold_color' => new sfWidgetFormInputColor(array('label' => 'Bold text color'), array('value' => sfPlop::get('sf_plop_block_bold_color'), 'title' => 'color', 'data-target' => $selector . ' b,' . $selector . ' strong')), 'sf_plop_block_italic_color' => new sfWidgetFormInputColor(array('label' => 'Italic text color'), array('value' => sfPlop::get('sf_plop_block_italic_color'), 'title' => 'color', 'data-target' => $selector . ' i,' . $selector . ' em')))); $this->setValidators(array('sf_plop_block_text_font' => new sfValidatorString(array('required' => false)), 'sf_plop_block_text_size' => new sfValidatorString(array('required' => false)), 'sf_plop_block_text_color' => new sfValidatorString(array('required' => false)), 'sf_plop_block_link_color' => new sfValidatorString(array('required' => false)), 'sf_plop_block_bold_color' => new sfValidatorString(array('required' => false)), 'sf_plop_block_italic_color' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); }
public function configure() { parent::configure(); $selector = 'body'; $this->setWidgets(array('sf_plop_background_image' => new sfWidgetFormAssetExtraChoice(array('label' => 'Background image'), array('value' => sfPlop::get('sf_plop_background_image'), 'data-property' => 'background-image', 'data-target' => $selector)), 'sf_plop_background_color' => new sfWidgetFormInputColor(array('label' => 'Background color'), array('value' => sfPlop::get('sf_plop_background_color'), 'data-property' => 'background-color', 'data-target' => $selector)), 'sf_plop_background_repeat' => new sfWidgetFormCssProperty(array('property' => 'background-repeat', 'label' => 'Background repetition'), array('value' => sfPlop::get('sf_plop_background_repeat'), 'data-property' => 'background-repeat', 'data-target' => $selector)), 'sf_plop_background_position_horizontal' => new sfWidgetFormCssProperty(array('property' => 'background-position-x', 'label' => 'Horizontal background position'), array('value' => sfPlop::get('sf_plop_background_position_horizontal'), 'data-property' => 'background-position-x', 'data-target' => $selector)), 'sf_plop_background_position_vertical' => new sfWidgetFormCssProperty(array('property' => 'background-position-y', 'label' => 'Vertical background position'), array('value' => sfPlop::get('sf_plop_background_position_vertical'), 'data-property' => 'background-position-y', 'data-target' => $selector)))); $this->setValidators(array('sf_plop_background_image' => new sfValidatorString(array('required' => false)), 'sf_plop_background_color' => new sfValidatorString(array('required' => false)), 'sf_plop_background_repeat' => new sfValidatorString(array('required' => false)), 'sf_plop_background_position_horizontal' => new sfValidatorString(array('required' => false)), 'sf_plop_background_position_vertical' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); }
public function initialize() { parent::initialize(); if (class_exists('sfPlop')) { sfPlop::loadPlugin(array('modules' => array('sf_extranet_dashboard' => array('name' => 'Extranet dashboard', 'route' => '@sf_extranet_dashboard'), 'sf_extranet_event' => array('name' => 'Extranet events', 'route' => '@sf_extranet_event'), 'sf_extranet_document' => array('name' => 'Extranet documents', 'route' => '@sf_extranet_document')))); } sfConfig::add(array('extranet_dashboard_pagination' => 10, 'extranet_anonymous_name' => 'Anonymous', 'extranet_event_fields' => array('title', 'description', 'date', 'is_published'), 'extranet_document_fields' => array('title', 'category', 'file', 'is_published'))); }
public function configure() { parent::configure(); $selector = '#container'; $this->setWidgets(array('sf_plop_icon' => new sfWidgetFormAssetExtraChoice(array('label' => 'Favicon'), array('value' => sfPlop::get('sf_plop_icon'))), 'sf_plop_css' => new sfWidgetFormAssetExtraChoice(array('label' => 'Stylesheet'), array('value' => sfPlop::get('sf_plop_css'))), 'sf_plop_js' => new sfWidgetFormAssetExtraChoice(array('label' => 'Javascript'), array('value' => sfPlop::get('sf_plop_js'))), 'sf_plop_website_width' => new sfWidgetFormCssProperty(array('property' => 'website-width', 'label' => 'Website width'), array('value' => sfPlop::get('sf_plop_website_width'), 'data-property' => 'width', 'data-target' => $selector)))); $this->setValidators(array('sf_plop_icon' => new sfValidatorString(array('required' => false)), 'sf_plop_css' => new sfValidatorString(array('required' => false)), 'sf_plop_js' => new sfValidatorString(array('required' => false)), 'sf_plop_website_width' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); }
public function getChoices() { $choices = sfPlop::getAllThemes(); if ($this->options['add_empty'] === true) { $choices = array('' => '') + $choices; } return $choices; }
public function configure() { parent::configure(); unset($this['updated_at'], $this['role'], $this['phone'], $this['theme'], $this['is_public']); $this->widgetSchema['culture'] = new sfWidgetFormPlopI18nChoiceLanguage(array('languages' => sfPlop::get('sf_plop_cultures'), 'default' => $this->getOption('user_culture'), 'culture' => $this->getOption('culture'))); $this->widgetSchema->setHelps(array('password' => null)); $this->validatorSchema['password'] = new sfValidatorString(array('min_length' => 6, 'max_length' => 128)); }
public function configure() { $this->setWidgets(array('sf_plop_custom_favicon' => new sfWidgetFormAssetExtraChoice(array('label' => 'Favicon'), array('value' => sfPlop::get('sf_plop_custom_favicon'))), 'sf_plop_custom_webapp_favicon' => new sfWidgetFormAssetExtraChoice(array('label' => 'Webapp icon'), array('value' => sfPlop::get('sf_plop_custom_webapp_favicon'))), 'sf_plop_use_image_zoom' => new sfWidgetFormInputCheckbox(array('label' => 'Use image zoom ?'), array('checked' => sfPlop::get('sf_plop_use_image_zoom') === true ? 'checked' : null)), 'sf_plop_use_html5' => new sfWidgetFormInputCheckbox(array('label' => 'Use HTML5 ?'), array('checked' => sfPlop::get('sf_plop_use_html5') === true ? 'checked' : null)), 'sf_plop_use_ajax' => new sfWidgetFormInputCheckbox(array('label' => 'Use Ajax in navigation menus ?'), array('checked' => sfPlop::get('sf_plop_use_ajax') === true ? 'checked' : null)), 'sf_plop_css' => new sfWidgetFormAssetExtraChoice(array('label' => 'Stylesheet'), array('value' => sfPlop::get('sf_plop_css'))), 'sf_plop_js' => new sfWidgetFormAssetExtraChoice(array('label' => 'Javascript'), array('value' => sfPlop::get('sf_plop_js'))), 'sf_plop_admin_theme' => new sfWidgetFormPlopChoiceAdminTheme(array('label' => 'Admin theme', 'add_empty' => true)))); $this->setDefault('sf_plop_admin_theme', sfPlop::get('sf_plop_admin_theme')); $this->setValidators(array('sf_plop_custom_favicon' => new sfValidatorString(array('required' => false)), 'sf_plop_custom_webapp_favicon' => new sfValidatorString(array('required' => false)), 'sf_plop_use_image_zoom' => new sfValidatorBoolean(), 'sf_plop_use_html5' => new sfValidatorBoolean(), 'sf_plop_use_ajax' => new sfValidatorBoolean(), 'sf_plop_admin_theme' => new sfValidatorPlopChoiceAdminTheme(array('required' => false)), 'sf_plop_css' => new sfValidatorString(array('required' => false)), 'sf_plop_js' => new sfValidatorString(array('required' => false)))); $this->widgetSchema->setHelps(array('sf_plop_custom_webapp_favicon' => 'This is used on smartphones when you create a shorcut on the desktop.')); parent::configure(); }
public function configure() { $this->setWidgets(array('sf_plop_default_culture' => new sfWidgetFormI18nChoiceLanguage(array('culture' => sfPlop::get('sf_plop_default_culture'), 'languages' => sfPlop::get('sf_plop_cultures'))), 'sf_plop_cultures' => new sfWidgetFormPlopI18nChoiceLanguage(array('expanded' => true, 'culture' => sfPlop::get('sf_plop_default_culture'), 'multiple' => true)))); $this->setDefault('sf_plop_default_culture', sfPlop::get('sf_plop_default_culture')); $this->setDefault('sf_plop_cultures', sfPlop::get('sf_plop_cultures')); $this->widgetSchema->setLabels(array('sf_plop_default_culture' => 'Default language', 'sf_plop_cultures' => 'Languages')); $this->setValidators(array('sf_plop_default_culture' => new sfValidatorI18nChoiceLanguage(array('languages' => sfPlop::get('sf_plop_cultures'))), 'sf_plop_cultures' => new sfValidatorI18nChoiceLanguage(array('multiple' => true)))); parent::configure(); }
public function getSlots() { $config_slots = sfPlop::get('sf_plop_cms_slot_templates', true); $loaded_slots = sfPlop::get('sf_plop_cms_loaded_slot_templates'); if (!$loaded_slots) { $loaded_slots = array(); } return array_merge($config_slots, $loaded_slots); }
public function getChoices() { $choices = array(); $themes = sfPlop::get('sf_plop_loaded_admin_themes'); foreach ($themes as $theme) { $choices[$theme['name']] = $theme['description']; } return array_keys($choices); }
public function configure() { parent::configure(); unset($this['created_at'], $this['updated_at']); $this->widgetSchema['image_id'] = new sfWidgetFormAssetExtraInput(); foreach (sfPlop::get('sf_plop_cultures') as $culture) { $this->embedForm($culture, new sfPlopShopProductI18nForm($this->getObject()->getTranslation($culture))); } }
protected function getParams($slot, $settings) { if (isset($settings['request_parameters']) && isset($settings['request_parameters']['theme'])) { $theme = $settings['request_parameters']['theme']['theme']; } else { $theme = sfPlop::get('sf_plop_theme'); } return array('default_theme' => sfPlop::get('sf_plop_theme'), 'theme' => $theme, 'form' => new sfPlopPublicThemeSwitcherForm(null, array('default_theme' => sfPlop::get('sf_plop_theme'), 'theme' => $theme))); }
protected function getParams($slot, $settings) { $relative_slug = $slot->getOption('relative_page', '', $settings['culture']); $localizations = sfPlop::get('sf_plop_cultures'); $displays = $slot->getOption('displays', array(), $settings['culture']); $hide_current = $slot->getOption('hide_current', false, $settings['culture']); $use_flag = in_array('icon', $displays) ? true : false; $use_label = in_array('title', $displays) || !$use_flag ? true : false; return array('relative_slug' => $relative_slug, 'localizations' => $localizations, 'displays' => $displays, 'hide_current' => $hide_current, 'use_flag' => $use_flag, 'use_label' => $use_label); }
public function getChoices() { $themes = sfPlop::get('sf_plop_loaded_themes'); $theme = sfPlop::get('sf_plop_theme'); $choices = array(); if (isset($themes[$theme]['subthemes']) && is_array($themes[$theme]['subthemes'])) { $choices = array_keys($themes[$theme]['subthemes']); } return $choices; }
public function getChoices() { $choices = sfPlop::getAllThemes(); foreach ($choices as $key => $choice) { if (is_array($choice)) { unset($choices[$key]); $choices += $choice; } } return array_keys($choices); }
protected function doSave($con = null) { $values = $this->values; parent::doSave($con); foreach (sfPlop::get('sf_plop_cultures') as $culture) { if ($values[$culture]['title'] == '') { $this->getObject()->setCulture($values[$culture]['locale']); $this->getObject()->setTitle('Page'); $this->getObject()->save(); } } }
public function getChoices() { $choices = array(); $themes = sfPlop::get('sf_plop_loaded_admin_themes'); foreach ($themes as $theme) { $choices[$theme['name']] = $theme['description']; } if ($this->options['add_empty'] === true) { $choices = array('' => '') + $choices; } return $choices; }
protected function getPluginLinks() { $exceptions = array(); $return = array(); $links = sfPlop::getSafePluginLinks(true); foreach ($links as $link => $infos) { if (!in_array($link, $exceptions)) { $return[$link] = $infos['name']; } } return $return; }
public function configure() { parent::configure(); unset($this['updated_at']); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('plopAdmin'); $this->widgetSchema['culture'] = new sfWidgetFormPlopI18nChoiceLanguage(array('languages' => sfPlop::get('sf_plop_cultures'), 'default' => $this->getOption('user_culture'), 'culture' => $this->getOption('culture'))); $this->validatorSchema['culture'] = new sfValidatorI18nChoiceLanguage(); $this->widgetSchema['is_public']->setLabel('Is public ?'); $this->widgetSchema['theme'] = new sfWidgetFormPlopChoiceAdminTheme(array('add_empty' => true)); $this->validatorSchema['theme'] = new sfValidatorPlopChoiceAdminTheme(array('required' => false)); $this->widgetSchema->getFormFormatter()->setHelpFormat(sfPlop::get('sf_plop_form_help_format')); $this->widgetSchema->setHelps(array('password' => 'To update the password, please fill the two "password" fields. Otherwise, let them empty.')); }