예제 #1
0
 * @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 string                  $statusMessage
 */
use DreamFactory\Common\Enums\PageLocation;
use DreamFactory\Platform\Yii\Models\BasePlatformSystemModel;
use DreamFactory\Yii\Utility\BootstrapForm;
use DreamFactory\Yii\Utility\Pii;
use Kisma\Core\Utility\Bootstrap;
use Kisma\Core\Utility\Option;
Pii::cssFile('//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.5/bootstrap-editable/css/bootstrap-editable.css');
Pii::scriptFile('//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.5/bootstrap-editable/js/bootstrap-editable.min.js', PageLocation::End);
$_css .= '<link href="" rel="stylesheet" />';
echo '<script src=""></script>';
//@TODO error handling from resource request
$_errors = isset($errors) ? Option::clean($errors) : array();
$_update = !$model->isNewRecord;
$_prefix = @end(@explode('\\', $this->getModelClass()));
$_resourcePath = $resourceName;
if ($_update) {
    $_resourcePath .= '/' . $model->id;
}
if (!empty($_errors)) {
    $_headline = isset($alertMessage) ? $alertMessage : 'Sorry pal...';
    $_messages = null;
    foreach ($_errors as $_error) {
        foreach ($_error as $_message) {
예제 #2
0
/**
 * @var $this   \Cerberus\Yii\Controllers\WebController
 * @var $models Instance[]
 */
use DreamFactory\Common\Enums\PageLocation;
use DreamFactory\Fabric\Yii\Models\Auth\User;
use DreamFactory\Fabric\Yii\Models\Deploy\Instance;
use DreamFactory\Yii\Utility\Pii;
if (!isset($models) || empty($models)) {
    $models = array();
}
$_html = null;
$_pdo = Pii::pdo('db.fabric_auth');
Pii::cssFile('/css/df.datatables.css');
Pii::scriptFile(array('/static/datatables/js/jquery.dataTables.js', '/js/df.datatables.js'), PageLocation::End);
foreach ($models as $_model) {
    if (isset($_model['email_addr_text'])) {
        $_email = '<a title="Click to view this user in Drupal" target="_blank" href="https://www.dreamfactory.com/user/' . $_model['drupal_id'] . '">' . $_model['email_addr_text'] . '</a>';
        $_lastLogin = $_model['last_login_date'];
    } else {
        $_email = 'Unknown';
        $_lastLogin = '******';
    }
    $_html .= '<tr id="' . $this->hashId($_model['id']) . '">';
    $_html .= '<td>' . $_model['instance_name_text'] . '<a title="Click to edit this row" class="pull-right" href="#"><i class="icon-pencil hide edit-row"></i></a></td>';
    $_html .= '<td><a title="Click to browse this URL" target="_blank" href="http://' . $_model['public_host_text'] . '">' . $_model['public_host_text'] . '</a></td>';
    $_html .= '<td>' . $_email . '</td>';
    $_html .= '<td>' . $_model['create_date'] . '</td>';
    $_html .= '<td>' . $_lastLogin . '</td>';
    $_html .= '</tr>';
예제 #3
0
<?php

/**
 * @var array $resourceColumns
 */
use DreamFactory\Common\Enums\PageLocation;
use DreamFactory\Platform\Enums\ResponseFormats;
use DreamFactory\Yii\Utility\Pii;
use Kisma\Core\Utility\Inflector;
use Kisma\Core\Utility\Option;
$_state = $_content = $_tabs = null;
Pii::scriptFile('/js/df.datatables.js', PageLocation::End);
//if ( null !== ( $_state = Pii::getState( 'admin.state' ) ) )
$_state = array();
$_class = ' class="active"';
foreach ($resourceColumns as $_resource => $_config) {
    $_html = '<h3>Coming Soon!</h3>';
    $_buttons = $_labels = null;
    $_active = $_resource == 'app' ? ' active' : null;
    //	Get/create a menu name
    $_menuName = Option::get($_config, 'menu_name', Option::get($_config, 'header', Inflector::pluralize($_config['resource'])));
    if (isset($_config['labels']) && !empty($_config['labels'])) {
        $_id = 'tab-' . $_resource;
        $_count = 0;
        foreach ($_config['labels'] as $_label) {
            $_labels .= '<th>' . $_label . '</th>';
            $_count++;
        }
        if (null !== ($_displayName = Option::get($_config, 'display_name'))) {
            $_buttons = '<button class="btn btn-success" id="create-' . $_resource . '">Add ' . $_displayName . '</button>';
        }