public function enqueueScripts() { $paths = Config::getPaths(); if (Config::useVueJs()) { Assets::addToFooter('js', 'typerocket-vue', $paths['urls']['js'] . '/vue.min.js'); } Assets::addToFooter('js', 'typerocket-image', $paths['urls']['js'] . '/image.js'); }
/** * Register the service provider. * * @return void */ public function register() { $paths = Config::getPaths(); // type ( js || css), id, path Assets::addToFooter('js', 'typerocket-jquery', $paths['urls']['js'] . '/jquery-3.1.1.min.js'); Assets::addToFooter('js', 'typerocket-core', $paths['urls']['js'] . '/typerocket.js'); Assets::addToHead('js', 'typerocket-global', $paths['urls']['js'] . '/global.js'); Assets::addToHead('css', 'typerocket-core', $paths['urls']['css'] . '/typerocket.css'); }
/** * Instance the From * * @param string $model the eloquent model * @param string $action update or create * @param null|int $itemId you can set this to null or an integer * @param string $path submit the form to this path */ public function __construct($model, $action = 'update', $itemId = null, $path = null) { $paths = Config::getPaths(); Assets::addToFooter('js', 'typerocket-core', $paths['urls']['js'] . '/typerocket.js'); Assets::addToHead('js', 'typerocket-global', $paths['urls']['js'] . '/global.js'); $this->resource = $model; $this->action = $action; $this->itemId = $itemId; $this->path = $path; if (!class_exists($model)) { $model = ucfirst($this->resource); $domain = env('TR_DOMAIN', 'App'); $model = "\\{$domain}\\{$model}"; } if (class_exists($model) && $this->itemId) { $this->model = call_user_func("{$model}::find", $this->itemId); } elseif (class_exists($model)) { $this->model = new $model(); } }
public function enqueueScripts() { $paths = Config::getPaths(); \TypeRocket\Assets::addToFooter('js', 'typerocket-editor', $paths['urls']['js'] . '/redactor.min.js'); }
private function getMatrixBlocks() { $val = $this->getValue(); $utility = new Buffer(); $blocks = ''; $form = $this->getForm(); $paths = Config::getPaths(); if (is_array($val)) { $utility->startBuffer(); foreach ($val as $tr_matrix_key => $data) { foreach ($data as $tr_matrix_type => $fields) { $tr_matrix_group = $this->getName(); $tr_matrix_type = lcfirst($tr_matrix_type); $root_group = $form->getGroup(); $form->setDebugStatus(false); $form->setGroup($root_group . "[{$tr_matrix_group}][{$tr_matrix_key}][{$tr_matrix_type}]"); $file = $paths['matrix_folder'] . "/" . $this->getName() . "/{$tr_matrix_type}.php"; $classes = "matrix-field-group tr-repeater-group matrix-type-{$tr_matrix_type} matrix-group-{$tr_matrix_group}"; $remove = '#remove'; ?> <div class="<?php echo $classes; ?> "> <div class="repeater-controls"> <div class="collapse glyphicon glyphicon-chevron-down"></div> <div class="move glyphicon glyphicon-menu-hamburger"></div> <a href="<?php echo $remove; ?> " class="remove glyphicon glyphicon-remove" title="remove"></a> </div> <div class="repeater-inputs"> <?php if (file_exists($file)) { /** @noinspection PhpIncludeInspection */ include $file; } else { echo "<div class=\"tr-dev-alert-helper\"><i class=\"icon tr-icon-bug\"></i> No Matrix file found <code>{$file}</code></div>"; } ?> </div> </div> <?php $form->setGroup($root_group); $form->setCurrentField($this); } } $utility->indexBuffer('fields'); $blocks = $utility->getBuffer('fields'); $utility->cleanBuffer(); } return trim($blocks); }
public function enqueueScripts() { $paths = Config::getPaths(); Assets::addToFooter('js', 'typerocket-booyah', $paths['urls']['js'] . '/booyah.js'); }
public function enqueueScripts() { $paths = Config::getPaths(); \TypeRocket\Assets::addToFooter('js', 'typerocket-items-list', $paths['urls']['js'] . '/items.js'); }