<?php /** * @var WebController $this * @var array $schema * @var BasePlatformSystemModel $model * @var array $_formOptions Provided by includer * @var array $errors Errors if any * @var string $resourceName The name of this resource (i.e. App, AppGroup, etc.) Essentially the model name * @var string $displayName * @var array $_data_ */ use DreamFactory\Yii\Utility\BootstrapForm; use Kisma\Core\Utility\Inflector; $update = false; $_form = new BootstrapForm(); $_options = array('breadcrumbs' => array('Admin Dashboard' => '/admin', Inflector::display($resourceName) . 's' => '/admin', $displayName => false)); $_formOptions = $_form->pageHeader($_options); // Render the form $this->renderPartial('_' . $resourceName . '_form', $_data_);
<div class="alert alert-error alert-block alert-fixed fade in" data-alert="alert"> \t<strong>{$_headline}</strong> \t{$_messages}</div> HTML; } if (null !== ($_status = Pii::getState('status_message'))) { echo <<<HTML <div class="alert alert-success alert-block fade in" data-alert="alert"> \t<strong>Success!</strong><br/> \t{$_status} </div> HTML; Pii::clearState('status_message'); } $_hashedId = $model->isNewRecord ? null : $this->hashId($model->id); $_form = new BootstrapForm(Bootstrap::Horizontal, array('id' => 'update-resource', 'method' => 'POST', 'x_editable_url' => '/admin/' . $resourceName . '/update', 'x_editable_pk' => $_hashedId, 'prefix' => $_prefix)); // Make sure the renderer removes these... $_form->setRemovePrefix(ConsoleController::SCHEMA_PREFIX); $_form->setFormData($model->getAttributes()); $_fields = array('Basic Settings' => array('api_name' => array('type' => 'text', 'class' => $model->isNewRecord ? 'required' : 'uneditable-input', 'placeholder' => 'How to address this provider via REST', 'hint' => 'The URI portion to be used when calling this provider. For example: "github", or "facebook".', 'maxlength' => 64), 'provider_name' => array('type' => 'text', 'class' => 'required' . ($_update ? ' x-editable' : null), 'hint' => 'The real name, or "display" name for this provider.', 'maxlength' => 64)), 'Configuration' => $schema, 'Metrics' => array('created_date' => array('type' => 'text', 'class' => 'uneditable-input'), 'last_modified_date' => array('type' => 'text', 'class' => 'uneditable-input'))); ?> <div class="row-fluid" style="border-bottom:1px solid #ddd"> <div class="pull-right"> <h2 style="margin-bottom: 0"><?php echo $displayName; ?> <small><?php echo $_update ? 'Edit' : 'New'; ?> </small> </h2>