<ul> <li><?php echo label_for('edit_topo_name', __('topoName_desc'), array('class' => 'fieldname', 'id' => '_topo_name')) . ' ' . input_tag('edit_topo_name', $user_private_data->get('topo_name'), array('class' => 'medium_input')); ?> </li> <li><?php echo label_for('edit_nickname', __('nickName_desc'), array('class' => 'fieldname', 'id' => '_nick_name')) . ' ' . input_tag('edit_nickname', $user_private_data->get('username'), array('class' => 'medium_input')); ?> </li> <li><?php echo label_for('login_name', __('LoginName_desc'), array('class' => 'fieldname', 'id' => '_login_name')) . '<strong>' . $user_private_data->getLoginName() . '</strong>'; ?> </li> </ul> <?php echo end_fieldset_tag(); echo fieldset_tag('Manage your profile page'); echo object_group_tag($user_private_data, 'is_profile_public', array('callback' => 'object_checkbox_tag')); echo end_fieldset_tag(); ?> <ul class="action_buttons"> <li><?php echo c2c_submit_tag(__('Save'), array('picto' => 'action_create')); ?> </li> </ul> </div> </div> </form>
<?php use_helper('Link', 'Language', 'MyForm', 'MyMinify', 'JavascriptQueue'); echo '<div id="fake_div">'; echo customization_nav('langpref'); ?> <div id="customize" class="form-row"> <?php echo fieldset_tag('Favorite language:'); ?> <ol id="languages-order"> <?php foreach ($sf_user->getPreferedLanguageList() as $language_code) { ?> <li id="<?php echo "lang_" . $language_code; ?> "><?php echo format_language_c2c($language_code); ?> </li> <?php } ?> </ol> <?php echo end_fieldset_tag(); echo __('Reorder these languages according to your preferences, using drag-and-drop'); // html5sortable is fine for desktop version, but it has no supprot for touch. It is very small and // follows the same api as jquery sortable
function form_for(moojon_base_model $model, $column_names = array(), $attributes = array(), $error_message = null) { if (!$error_message) { $error_message = moojon_config::get('validation_error_message'); } $attributes = try_set_attribute($attributes, 'method', 'post'); $attributes = try_set_action_attribute($model, $attributes); $controls = array(); if ($model->get_new_record()) { $submit_value = 'Create'; $id = 'new'; } else { $controls[] = method_tag('put'); $controls[] = redirection_tag(moojon_server::redirection()); $submit_value = 'Update'; $id = 'edit'; } $form_id = $id .= '_' . get_class($model) . '_form'; $attributes = try_set_attribute($attributes, 'id', $form_id); $column_names = $column_names ? $column_names : $model->get_ui_editable_column_names(); foreach ($column_names as $key => $column_name) { /*if (!is_numeric($key)) { $model->$key = $column_name; $column_name = $key; }*/ $column = $model->get_column($column_name); if (get_class($column) == 'moojon_string_column' && $column->is_file()) { $attributes['enctype'] = 'multipart/form-data'; } $controls[] = control($model, $column_name); } $controls[] = primary_key_tag($model, $model->get_column(get_primary_key_id_property($model))); $children = array(); $children[] = error_dl($error_message, $model->get_validator_messages(), array('id' => $form_id . '_errors')); $children[] = fieldset_tag($controls); $children[] = actions_ul(array(submit_input_tag(array('value' => $submit_value, 'class' => 'submit', 'name' => 'submit')))); return form_tag($children, $attributes); }
function login_form($authenticated = false, $message = null, $redirect = null, $attributes = array()) { if (!$authenticated) { $security_identity_label = moojon_config::get('security_identity_label'); $security_password_label = moojon_config::get('security_password_label'); $security_remember_label = moojon_config::get('security_remember_label'); $security_key = moojon_config::get('security_key'); $security_identity_key = moojon_config::get('security_identity_key'); $security_password_key = moojon_config::get('security_password_key'); $security_remember_key = moojon_config::get('security_remember_key'); if (moojon_security::login_attempt($security_key)) { $security = moojon_request::get($security_key); $security_identity_value = $security[$security_identity_key]; $security_password_value = $security[$security_password_key]; $security_remember_value = $security[$security_remember_key]; } else { $security_remember_value = null; $security_identity_value = null; $security_password_value = null; $security_checked_value = null; } $child = form_tag(null, array('action' => '#', 'method' => 'post')); if ($redirect) { $child->add_child(redirection_tag($redirect)); } if ($message) { $child->add_child(p_tag($message, array('class' => 'error'))); } $fieldset = fieldset_tag(); $fieldset->add_child(label_tag($security_identity_label, $security_identity_key)); $fieldset->add_child(text_input_tag(array('id' => $security_identity_key, 'name' => attribute_array_name($security_key, $security_identity_key), 'value' => $security_identity_value))); $fieldset->add_child(label_tag($security_password_label, $security_password_key)); $fieldset->add_child(password_input_tag(array('id' => $security_password_key, 'name' => attribute_array_name($security_key, $security_password_key), 'value' => $security_password_value))); $div = div_tag(null, array('class' => 'checkbox')); $div->add_child(hidden_input_tag(array('name' => attribute_array_name($security_key, $security_remember_key), 'value' => 0))); $remember_attributes = array('name' => attribute_array_name($security_key, $security_remember_key), 'value' => 1, 'id' => $security_remember_key); if ($security_remember_value) { $remember_attributes['checked'] = 'checked'; } $div->add_child(checkbox_input_tag($remember_attributes)); $div->add_child(label_tag($security_remember_label, $security_remember_key)); $fieldset->add_child($div); $child->add_child($fieldset); $child->add_child(submit_input_tag(array('name' => attribute_array_name($security_key, 'submit'), 'value' => 'Login'))); } else { $child = p_tag('You are logged in.'); } return div_tag($child, array('id' => 'login_div')); }