Пример #1
0
<?php 
use_stylesheet('main.css');
$sfExtjs3Plugin = new sfExtjs3Plugin(array('theme' => 'blue'), array('js' => sfConfig::get('sf_extjs3_js_dir') . 'src/locale/ext-lang-' . $sf_user->getCulture() . '.js'));
$sfExtjs3Plugin->load();
?>

<script type='text/javascript'>

Ext.MessageBox.show({
    title: <?php 
echo json_encode(__('Warning - Central Management'));
?>
,
    msg: <?php 
echo json_encode(__('Please update Central Management DB'));
?>
,
    minWidth: 300,
    renderTo: Ext.get('updatedb-id'),
    //buttons: Ext.MessageBox.OK,
    //fn: Login.focusForm,
    icon: Ext.MessageBox.ERROR
});

</script>


<div class="header-login <?php 
echo sfConfig::get('config_acronym');
?>
Пример #2
0
<?php

use_stylesheet('main.css');
$sfExtjs3Plugin = new sfExtjs3Plugin(array('theme' => 'blue'), array('js' => sfConfig::get('sf_extjs3_js_dir') . 'src/locale/ext-lang-' . $sf_user->getCulture() . '.js'));
$sfExtjs3Plugin->load();
/*
 * Create dynamic form fields from the form schema
 * TODO: create a helper??!!
 */
$fieldSc = $form->getFormFieldSchema();
$loginFormItems = '';
$widget = $fieldSc->getWidget();
$validatorSchema = $form->getValidatorSchema();
foreach ($widget->getFields() as $key => $object) {
    $label = $fieldSc->offsetGet($key)->renderLabelName();
    $type = $object->getOption('type');
    if ($type == 'text') {
        $type = 'textfield';
    }
    $name = $widget->generateName($key);
    $allowBlank = 'true';
    $extraItem = '';
    if ($validatorSchema[$key] instanceof sfValidatorCSRFToken) {
        $csrfToken = $form->getDefault($key);
        $extraItem = ",value:'" . $csrfToken . "'";
    }
    if (isset($validatorSchema[$key]) and $validatorSchema[$key]->getOption('required') == true) {
        $allowBlank = 'false';
    }
    $loginFormItems[] = "{fieldLabel: '" . __($label) . "',name: '" . $name . "',inputType:'" . $type . "',allowBlank:" . $allowBlank . $extraItem . "}\n\t\t";
}