/**
  * List the Builder's registry templates.
  */
 public function handle()
 {
     $this->logo();
     $type = $this->argument('addon');
     $filter = in_array($type, config('streams::addons.types'));
     $title = title_case($filter ? "{$type} " : '') . 'templates                ';
     /*
       Get a list of all repositories from cache or builder templates registry.
       Return all addon types or filter on $type provided
     */
     $this->info("Retrieving a list of available {$title}");
     $this->flush($this->getCacheKey($this->registry));
     $repos = app('cache')->remember($this->getCacheKey($this->registry), $this->ttl, function () use($type, $filter) {
         return collect($this->client->api('user')->repositories($this->registry))->map(function ($values) {
             return array_only($values, ['name', 'stargazers_count', 'description']);
         })->filter(function ($repo) use($filter, $type) {
             return $filter ? str_contains($repo['name'], "-{$type}") : true;
         });
     });
     if ($repos->count() > 0) {
         $this->table(['Name', 'Description', '★'], $repos);
     } else {
         $this->comment("There are no available {$title}");
     }
 }
 function title_case($title)
 {
     // words to capitalise
     $uc_stopwords = array('3m', '5s', 'tpm', 'diy', 'cbs', 'cbt', 'cdm');
     // special words to handle (from shakespeare)
     $exact_stopwords = array('macneil' => 'MacNeil', 'macmorris' => 'MacMorris', 'macmillan' => 'MacMillan', 'machomer' => 'MacHomer', 'macready' => 'MacReady', 'c\'est' => 'c\'est');
     return title_case($title, null, $uc_stopwords, $exact_stopwords);
 }
Esempio n. 3
0
 public function __construct(Model $model, $base = 'base')
 {
     parent::__construct($model, $base);
     $this->bodyClass = 'skin-blue sidebar-mini sidebar-collapse';
     $this->breadcrumb1 = title_case(trans('livecms::livecms.home'));
     $this->breadcrumb1Icon = 'home fa-lg';
     $this->breadcrumb2 = title_case(trans('livecms::livecms.' . $this->base));
     // $this->breadcrumb2Url   = route($this->baseClass.'.index');
     $this->view->share();
 }
Esempio n. 4
0
 public function getFields()
 {
     $fields = $this->buildFields();
     $alias = $this->aliases;
     $theFields = [];
     foreach ($fields as $field) {
         $theFields[$field] = isset($alias[$field]) ? $alias[$field] : title_case($this->snakeToStr($field));
     }
     $keyName = $this->getKeyName();
     return !array_key_exists($keyName, $theFields) ? [$keyName => $this->snakeToStr($keyName)] + $theFields : $theFields;
 }
Esempio n. 5
0
 /**
  * Checks if the given data has a type and that type is a model that
  * exists.
  *
  * @param  string    $attribute  The attribute name
  * @param  mixed     $value      The value of the attribute
  * @param  array     $parameters Any parameters passed into rule
  * @param  Validator $validator  The validator instance
  *
  * @return boolean
  */
 public function validate($attribute, $value, $parameters, $validator)
 {
     if (!isset($value->type)) {
         return false;
     }
     $modelClassName = '\\App\\Models\\' . title_case($value->type);
     if (!class_exists($modelClassName)) {
         return false;
     }
     return true;
 }
Esempio n. 6
0
 public function index(Request $request)
 {
     $this->title = title_case($this->getTrans($this->base));
     $this->description = $this->getTrans('alllist', ['list' => title_case($this->getTrans($this->base))]);
     $this->breadcrumb3 = $this->getTrans('seeall');
     if (isset($this->query['hierarchy'])) {
         $this->fields = array_except($this->fields, ['parent']);
     }
     $this->view->share();
     return view('livecms::admin.staticpage.index' . ($request->has('hierarchy') ? 'Hierarchy' : 'All'));
 }
Esempio n. 7
0
 public function render($events)
 {
     return collect(array_combine(self::$IMAGES, str_split($events)))->filter(function ($event) {
         return $event;
     })->map(function ($event, $image) {
         return '<img src="' . asset('images/' . $image . '.png') . '"
                          class="weather-event weather-event--' . $image . '"
                          alt="' . title_case($image) . '"
                          title="' . title_case($image) . '" />';
     })->implode(' ');
 }
Esempio n. 8
0
 public function index(Request $request)
 {
     $model = $this->model->find(auth()->user()->id);
     ${camel_case($this->base)} = $model;
     $this->title = title_case(trans('livecms::livecms.' . $this->base));
     $this->description = trans('livecms::livecms.homeprofile');
     $this->breadcrumb3 = trans('livecms::livecms.myprofile');
     $this->params = array_merge($request->query() ? $request->query() : []);
     $this->action = 'store';
     $this->view->share();
     return view('livecms::user.profile.home', compact(camel_case($this->base)));
 }
Esempio n. 9
0
 public function show(CourseRepositoryInterface $repo, SectionRepositoryInterface $sectionRepo, $subject_id, $course_id)
 {
     $course = $repo->find($course_id);
     $sections = $sectionRepo->all($course_id);
     $terms = [];
     foreach ($sections as $section) {
         if (!array_key_exists($section['term'], $terms)) {
             $terms[$section['term']] = ['id' => $section['term'], 'name' => term_name($section['term']), 'sections' => []];
         }
         $terms[$section['term']]['sections'][] = $section;
     }
     array_set($course, 'sections', $sections);
     return $this->view->make('frontend.courses.show', ['course' => $course, 'single_page' => true, 'terms' => $terms, 'title' => sprintf('Which Course For Me | %s - %s', $course['id'], title_case($course['title']))]);
 }
Esempio n. 10
0
 /**
  * Make a transformer validator from the type given.
  *
  * @param string $type Type of validator to make
  *
  * @return \App\Api\V1\Transformers\Validator|null
  */
 public function makeValidator($type)
 {
     if (array_key_exists($type, $this->validators)) {
         return $this->validators[$type]->reset();
     }
     $className = 'App\\Api\\V1\\Transformers\\Validators\\' . title_case($type) . 'Validator';
     try {
         $validator = app($className);
     } catch (ReflectionException $exception) {
         return null;
     }
     $this->validators[$type] = $validator;
     return $validator;
 }
Esempio n. 11
0
 public function handle()
 {
     if (($table = $this->option('table')) === null) {
         $tables = $this->DBHelper->listTables();
         $table = $this->choice('Choose table:', $tables, null);
     }
     $columns = collect($this->DBHelper->listColumns($table));
     $this->transformer->setColumns($columns);
     $namespace = config('thunderclap.namespace');
     $moduleName = str_replace('_', '', title_case($table));
     $containerPath = config('thunderclap.target_dir', base_path('modules'));
     $modulePath = $containerPath . DIRECTORY_SEPARATOR . $moduleName;
     // 1. check existing module
     if (is_dir($modulePath)) {
         $overwrite = $this->confirm("Folder {$modulePath} already exist, do you want to overwrite it?");
         if ($overwrite) {
             File::deleteDirectory($modulePath);
         } else {
             return false;
         }
     }
     // 2. create modules directory
     $this->info('Creating modules directory...');
     $this->packerHelper->makeDir($containerPath);
     $this->packerHelper->makeDir($modulePath);
     // 3. copy module skeleton
     $stubs = __DIR__ . '/../../stubs';
     $this->info('Copying module skeleton into ' . $modulePath);
     File::copyDirectory($stubs, $modulePath);
     $templates = ['module-name' => str_replace('_', '-', $table), 'route-prefix' => config('thunderclap.routes.prefix')];
     // 4. rename file and replace common string
     $search = [':Namespace:', ':module_name:', ':module-name:', ':module name:', ':Module Name:', ':moduleName:', ':ModuleName:', ':FILLABLE:', ':TRANSFORMER_FIELDS:', ':VALIDATION_RULES:', ':LANG_FIELDS:', ':TABLE_HEADERS:', ':TABLE_FIELDS:', ':DETAIL_FIELDS:', ':FORM_CREATE_FIELDS:', ':FORM_EDIT_FIELDS:', ':VIEW_EXTENDS:', ':route-prefix:', ':route-middleware:', ':route-url-prefix:'];
     $replace = [$namespace, snake_case($table), $templates['module-name'], str_replace('_', ' ', strtolower($table)), ucwords(str_replace('_', ' ', $table)), str_replace('_', '', camel_case($table)), str_replace('_', '', title_case($table)), $this->transformer->toFillableFields(), $this->transformer->toTransformerFields(), $this->transformer->toValidationRules(), $this->transformer->toLangFields(), $this->transformer->toTableHeaders(), $this->transformer->toTableFields(), $this->transformer->toDetailFields(), $this->transformer->toFormCreateFields(), $this->transformer->toFormUpdateFields(), config('thunderclap.view.extends'), $templates['route-prefix'], $this->toArrayElement(config('thunderclap.routes.middleware')), $this->getRouteUrlPrefix($templates['route-prefix'], $templates['module-name'])];
     foreach (File::allFiles($modulePath) as $file) {
         if (is_file($file)) {
             $newFile = $deleteOriginal = false;
             if (Str::endsWith($file, '.stub')) {
                 $newFile = Str::substr($file, 0, -5);
                 $deleteOriginal = true;
             }
             $this->packerHelper->replaceAndSave($file, $search, $replace, $newFile, $deleteOriginal);
         }
     }
     $this->warn('Add following service provider to config/app.php ====> ' . $namespace . '\\' . ucwords(str_replace('_', ' ', $table)) . '\\ServiceProvider::class,');
 }
 public function update(MaterialRequest $request, Material $material)
 {
     // Update material
     if (isset($request->title)) {
         $material->title = ucwords($request->title);
         $material->slug = str_slug($request->title, '-');
     }
     if (isset($request->objective)) {
         $material->objective = ucfirst(strtolower($request->objective));
     }
     if (isset($request->target_language)) {
         $material->target_language = ucfirst(strtolower($request->target_language));
     }
     if (isset($request->time_needed_prep)) {
         $material->time_needed_prep = $request->time_needed_prep;
     }
     if (isset($request->time_needed_class)) {
         $material->time_needed_class = $request->time_needed_class;
     }
     if (isset($request->materials)) {
         $material->materials = ucfirst(strtolower($request->materials));
     }
     if (isset($request->procedure_before)) {
         $material->procedure_before = ucfirst($request->procedure_before);
     }
     if (isset($request->procedure_in)) {
         $material->procedure_in = ucfirst($request->procedure_in);
     }
     // store files
     $dir = Auth::user()->username;
     $path = public_path() . '/users/' . $dir;
     $empty = count(glob("{$path}/*")) === 0 ? true : false;
     if (!$empty) {
         $files = [];
         foreach (glob("{$path}/*") as $filename) {
             array_push($files, $filename);
         }
         MaterialFile::store($files, $material);
     }
     if (isset($request->category_list)) {
         // add category to categories table
         $categoryIds = [];
         //find or create new categories on material_category table
         foreach ($request->Input('category_list') as $category) {
             $material_category = Auth::user()->material_category()->firstOrCreate(['category' => title_case($category), 'slug' => str_slug($category, '-')]);
             array_push($categoryIds, $material_category->id);
             // update category to materials pivot table category / material
         }
         $material->categories()->sync($categoryIds);
     }
     if (isset($request->level)) {
         $levelIds = [];
         foreach ($request->Input('level') as $level) {
             $material_level = MaterialLevel::firstOrCreate(['level' => title_case($level), 'slug' => str_slug($level, '-')]);
             array_push($levelIds, $material_level->id);
         }
         // update level on materials pivot
         $material->levels()->sync($levelIds);
     }
     if (isset($request->language_focus)) {
         //add language focuses to material_language_focuses database
         $language_focusIds = [];
         foreach ($request->language_focus as $lf) {
             $material_language_focus = MaterialLanguageFocus::firstOrCreate(['language_focus' => title_case($lf), 'slug' => str_slug($lf, '-')]);
             array_push($language_focusIds, $material_language_focus->id);
         }
         // update language focus to materials pivot
         $material->languageFocuses()->sync($language_focusIds);
     }
     if (isset($request->activity_use)) {
         //add activity use to material_activity_uses database
         $activity_useIds = [];
         foreach ($request->activity_use as $au) {
             $material_activity_use = MaterialActivityUse::firstOrCreate(['activity_use' => title_case($au), 'slug' => str_slug($au, '-')]);
             array_push($activity_useIds, $material_activity_use->id);
         }
         // update activity use to materials pivot
         $material->activityUses()->sync($activity_useIds);
     }
     if (isset($request->pupil_task)) {
         //add pupil task to material_pupil_tasks database
         $pupil_taskIds = [];
         foreach ($request->pupil_task as $pt) {
             $material_pupil_task = MaterialPupilTask::firstOrCreate(['pupil_task' => title_case($pt), 'slug' => str_slug($pt, '-')]);
             array_push($pupil_taskIds, $material_pupil_task->id);
         }
         // add pupil task use to materials pivot
         $material->pupilTasks()->sync($pupil_taskIds);
     }
     if (isset($request->book)) {
         $book = MaterialBook::firstOrCreate(['book' => $request->book[0], 'slug' => str_slug($request->book[0], '-')]);
         $material->book_id = $book->id;
     }
     if (isset($request->page)) {
         $material->page = $request->page;
     }
     if (isset($request->follow_up)) {
         //update material
         $material->follow_up = ucfirst($request->follow_up);
     }
     if (isset($request->variations)) {
         $material->variations = ucfirst($request->variations);
     }
     if (isset($request->tips)) {
         $material->tips = ucfirst($request->tips);
     }
     if (isset($request->notes)) {
         $material->notes = ucfirst($request->notes);
     }
     $material->update();
     return redirect()->action('Admin\\UserController@home');
 }
    print $block['content'];
}
?>
    <h3>Share This</h3>
    <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
    <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
    <ul>
    <li><fb:like href="http://www.aadl.org/catalog/record/<?php 
echo $item['_id'];
?>
" layout="button_count" show_faces="false" width="450" font=""></fb:like></li>
    <li><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://www.aadl.org/catalog/record/<?php 
echo $item['_id'];
?>
" data-text="Enjoying <?php 
echo title_case($item['title']);
?>
" data-count="none" data-via="aadl">Tweet</a></li>
    </ul>
    
  <!-- end left-hand column -->
  </div>


  <!-- begin right-hand column -->
  <div class="item-right">

    <div class="item-main">
    <!-- Item Format Icon -->
    <ul class="item-format-icon">
      <li><img src="<?php 
 /**
  * Returns fully class name for form
  *
  * @return string
  */
 protected function getFormPath()
 {
     $model = title_case(str_plural($this->model));
     return 'App\\Forms\\Admin\\' . $model . 'Form';
 }
Esempio n. 15
0
 public function getTitleAttribute()
 {
     return title_case($this->attributes['title']);
 }
Esempio n. 16
0
 /**
  * Detach a social account from a user.
  * @param $socialDriver
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function detachSocialAccount($socialDriver)
 {
     session();
     user()->socialAccounts()->where('driver', '=', $socialDriver)->delete();
     session()->flash('success', title_case($socialDriver) . ' account successfully detached');
     return redirect(user()->getEditUrl());
 }
Esempio n. 17
0
 private function createCourse(Subject $subj)
 {
     $title = title_case($this->faker->sentence(5));
     $level = $this->faker->numberBetween(100, 800);
     $description = $this->faker->text(200);
     $data = ['id' => sprintf('%s%d', $subj->id, $level), 'subject_id' => $subj->id, 'level' => $level, 'title' => $title, 'description' => $description];
     try {
         Course::create($data);
     } catch (QueryException $e) {
     }
 }
 /**
  * Display the changes, if any.
  */
 public function changes($school)
 {
     // check for changes from origina;
     if ($school->isDirty()) {
         // display them
         $this->comment($school->name);
         foreach ($school->getDirty() as $key => $change) {
             $this->info(' ' . title_case($key) . ' = ' . $change);
         }
         $this->changes++;
         return true;
     }
     return false;
 }
Esempio n. 19
0
 public function get_types_flat()
 {
     $_types = $this->get_types();
     $_out = array();
     foreach ($_types as $type) {
         $_out[$type->id] = $type->label ? $type->label : title_case(str_replace('_', ' ', $type->slug));
     }
     return $_out;
 }
Esempio n. 20
0
 function _genderise($old_pre, $old, $old_post, $new)
 {
     //	Determine case
     $case = NULL;
     // work it out here...
     if (ctype_upper($old)) {
         $case = 'upper';
     }
     if (ctype_lower($old)) {
         $case = 'lower';
     }
     if (preg_match('/[A-Z][a-z]+/', $old)) {
         $case = 'title';
     }
     //	Transform string
     switch ($case) {
         case 'lower':
             return $old_pre . strtolower($new) . $old_post;
             break;
         case 'upper':
             return $old_pre . strtoupper($new) . $old_post;
             break;
         case 'title':
             return $old_pre . title_case($new) . $old_post;
             break;
     }
     return $old_pre . $new . $old_post;
 }
 private function generateShow()
 {
     $fieldTemplate = $this->getTemplate($this->templatePath . 'form_field.blade');
     $fields = [];
     foreach ($this->fillableColumns as $column) {
         $fields[] = $this->compile($fieldTemplate, ['FIELD_NAME' => $column['field'], 'LABEL' => title_case(str_replace('_', ' ', $column['field']))]);
     }
     $templateData = $this->templateData;
     $templateData['FIELDS'] = implode("\n\n", $fields);
     $filename = 'show.blade.php';
     $this->generateFile($filename, $templateData, $this->templatePath . 'show.blade');
 }
Esempio n. 22
0
 /**
  * Handle the login process on a oAuth callback.
  * @param $socialDriver
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  * @throws SocialDriverNotConfigured
  * @throws SocialSignInException
  */
 public function handleLoginCallback($socialDriver)
 {
     $driver = $this->validateDriver($socialDriver);
     // Get user details from social driver
     $socialUser = $this->socialite->driver($driver)->user();
     $socialId = $socialUser->getId();
     // Get any attached social accounts or users
     $socialAccount = $this->socialAccount->where('driver_id', '=', $socialId)->first();
     $user = $this->userRepo->getByEmail($socialUser->getEmail());
     $isLoggedIn = auth()->check();
     $currentUser = auth()->user();
     // When a user is not logged in and a matching SocialAccount exists,
     // Simply log the user into the application.
     if (!$isLoggedIn && $socialAccount !== null) {
         return $this->logUserIn($socialAccount->user);
     }
     // When a user is logged in but the social account does not exist,
     // Create the social account and attach it to the user & redirect to the profile page.
     if ($isLoggedIn && $socialAccount === null) {
         $this->fillSocialAccount($socialDriver, $socialUser);
         $currentUser->socialAccounts()->save($this->socialAccount);
         \Session::flash('success', title_case($socialDriver) . ' account was successfully attached to your profile.');
         return redirect($currentUser->getEditUrl());
     }
     // When a user is logged in and the social account exists and is already linked to the current user.
     if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id === $currentUser->id) {
         \Session::flash('error', 'This ' . title_case($socialDriver) . ' account is already attached to your profile.');
         return redirect($currentUser->getEditUrl());
     }
     // When a user is logged in, A social account exists but the users do not match.
     // Change the user that the social account is assigned to.
     if ($isLoggedIn && $socialAccount !== null && $socialAccount->user->id != $currentUser->id) {
         \Session::flash('success', 'This ' . title_case($socialDriver) . ' account is already used by another user.');
         return redirect($currentUser->getEditUrl());
     }
     // Otherwise let the user know this social account is not used by anyone.
     $message = 'This ' . $socialDriver . ' account is not linked to any users. Please attach it in your profile settings';
     if (setting('registration-enabled')) {
         $message .= ' or, If you do not yet have an account, You can register an account using the ' . $socialDriver . ' option';
     }
     throw new SocialSignInException($message . '.', '/login');
 }
Esempio n. 23
0
function sphsc4()
{
    /*******
    	$results = db_select('node', 'n')
    		->fields('n')
    		//->orderBy('length(alias)', 'ASC')
    		->condition('n.title', '%placeholder%', 'like')
    		->execute()
    		->fetchAll();
    		
    	foreach($results as $k => $data) {
    		print "\n". $data->nid;
    		var_dump(node_delete($data->nid)); 
    	}
    
    	exit;*/
    $query = db_select('url_alias', 'a');
    $query->join('menu_links', 'm', 'm.link_path = a.source');
    $query->fields('a')->fields('m')->condition('link_title', 'Scholarships & Special Funds')->orderBy('length(a.alias)', 'ASC');
    $results = $query->execute()->fetchAll();
    //print_r($results);
    // db_insert('custom_table_name')->fields(array(
    // 	'id' => $account->uid,
    // 	'text' => 'some text'
    // ))->execute();
    foreach ($results as $k => $data) {
        continue;
        $path = explode('/', $data->alias);
        $n = count($path);
        $suffix = $n > 1 ? $path[$n - 1] : $data->alias;
        $suffix = $n > 2 ? $path[$n - 2] . " - " . $path[$n - 1] : $data->alias;
        $data->link_title = $data->link_title . " -- " . title_case($suffix);
        print "\n" . $data->link_title;
        $updates[] = db_update('menu_links')->fields(array('link_title' => $data->link_title))->condition('mlid', $data->mlid)->execute();
        $updates[] = db_update('node')->fields(array('title' => $data->link_title))->condition('nid', str_replace('node/', '', $data->source))->execute();
    }
}
Esempio n. 24
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Request $request, $id)
 {
     $model = $this->model->findOrFail($id);
     ${camel_case($this->base)} = $model;
     $this->title = $this->getTrans('editdata', ['data' => title_case($this->getTrans($this->base))]);
     $this->description = $this->getTrans('editingdata', ['data' => $this->getTrans($this->base)]);
     $this->breadcrumb3 = $this->getTrans('edit');
     $this->action = 'update';
     $this->params = array_merge($request->query() ? $request->query() : [], compact('id'));
     $this->view->share();
     $this->loadFormClasses($model);
     return view('livecms::' . $this->groupName . '.' . camel_case($this->base) . '.form', compact(camel_case($this->base)));
 }
Esempio n. 25
0
 /**
  * Deletes a user
  *
  * @access	public
  * @param	none
  * @return	void
  **/
 public function delete()
 {
     //	Get the user's details
     $_uid = $this->uri->segment(4);
     $_user = $this->user_model->get_by_id($_uid);
     // --------------------------------------------------------------------------
     //	Non-superusers editing superusers is not cool
     if (!$this->user_model->is_superuser() && user_has_permission('superuser', $_user)) {
         $this->session->set_flashdata('error', lang('accounts_edit_error_noteditable'));
         redirect($this->input->get('return_to'));
         return;
     }
     // --------------------------------------------------------------------------
     //	Delete user
     $_user = $this->user_model->get_by_id($_uid);
     if (!$_user) {
         $this->session->set_flashdata('error', lang('accounts_edit_error_unknown_id'));
         redirect($this->input->get('return_to'));
         return;
     }
     // --------------------------------------------------------------------------
     //	Define messages
     if ($this->user_model->destroy($_uid)) {
         $this->session->set_flashdata('success', lang('accounts_delete_success', title_case($_user->first_name . ' ' . $_user->last_name)));
         //	Update admin changelog
         _ADMIN_CHANGE_ADD('deleted', 'a', 'user', $_uid, '#' . number_format($_uid) . ' ' . $_user->first_name . ' ' . $_user->last_name);
     } else {
         $this->session->set_flashdata('error', lang('accounts_delete_error', title_case($_user->first_name . ' ' . $_user->last_name)));
     }
     // --------------------------------------------------------------------------
     redirect($this->input->get('return_to'));
 }
Esempio n. 26
0
 /**
  * Generate Form Tag
  *
  * @param $attributes
  * @param Collection $attributes
  * @return string
  */
 protected function generateTag(Collection $attributes = null)
 {
     /**
      * Process Append Class
      */
     if ($appendClass = $attributes->pull('appendClass', null)) {
         $attributes->put('class', $attributes->get('class') . ' ' . $appendClass);
     }
     /**
      * Process Label
      */
     if ($label = $attributes->pull('label', null)) {
         $label = $this->makeLabel($this->trans($label));
     }
     /**
      * Process Errors
      */
     $error = $attributes->pull('error', null);
     $params = $this->collection->make();
     /**
      * Remove Element from attributes list
      * Define Attribute to be send for each kind of tag
      */
     switch ($tag = $attributes->pull('element')) {
         case 'hidden':
             $params->push([$attributes]);
             break;
         case 'select':
             $params->push([$attributes->forget('type'), $attributes->pull('collection'), $attributes->pull('placeholder'), $label]);
             break;
         case 'button':
             $params->push([$attributes, $attributes->pull('content')]);
             break;
         case 'errorMessage':
             $params->push([$attributes, $attributes->pull('errors'), $attributes->pull('title')]);
             break;
         default:
             $params->push([$attributes, $label, $error]);
             break;
     }
     /**
      * Call function with params
      */
     return call_user_func_array(array($this, 'make' . title_case($tag)), $params->collapse()->toArray());
 }
Esempio n. 27
0
				<th class="datetime">Date</th>
				<th class="user">User</th>
				<th class="event">Type of Event</th>
				<th class="actions">Actions</th>
			</tr>
		</thead>
		<tbody>
		<?php 
if ($events) {
    foreach ($events as $event) {
        echo '<tr class="event">';
        $this->load->view('admin/_utilities/table-cell-datetime', array('datetime' => $event->created));
        $this->load->view('admin/_utilities/table-cell-user', $event->user);
        // --------------------------------------------------------------------------
        echo '<td class="event">';
        echo $event->type->label ? $event->type->label : title_case(str_replace('_', ' ', $event->type->slug));
        echo '<small>' . $event->type->description . '</small>';
        echo '</td>';
        // --------------------------------------------------------------------------
        if ($event->data) {
            echo '<td class="actions">';
            echo '<a href="#data-' . $event->id . '" class="awesome small fancybox">View Data</a>';
            echo '<div id="data-' . $event->id . '" style="display:none;">';
            echo '<p class="system-alert message"><strong>Note:</strong> This is raw, unformatted data associated with the event.<br />The system uses this information to specify specific items relating to this particular event.</p>';
            echo '<div style="white-space:pre; margin-top:1em;padding:1em;border:1px dashed #CCC;background:#EFEFEF;">';
            echo print_r($event->data, TRUE);
            echo '</div>';
            echo '</div>';
            echo '</td>';
        } else {
            echo '<td class="actions no-data">&mdash;</td>';
Esempio n. 28
0
 function month($update)
 {
     return title_case($update->created_at->format(static::MONTH_FORMAT));
 }
Esempio n. 29
0
 /**
  * Suggest store names with given terms
  *
  * @param mixed
  * @param integer
  * @return array store names
  */
 public static function suggest($inputTerms, $limit)
 {
     $company_liability_types = ['Ltd.', 'GmbH', 's.r.o.', 'sp. z o.o.', 'LLC', 'Groups'];
     // $splitted_terms = preg_split("/[\s]+/", $inputTerms);
     $companies = array();
     foreach ($company_liability_types as $key => $value) {
         $companies[] = title_case($inputTerms) . ' ' . date("Y") . ' ' . $company_liability_types[$key];
     }
     return $companies;
 }
Esempio n. 30
0
    </div>
    <div class="hitlist-info">
      <?php 
    if ($locum_result['active'] == '0') {
        print '<div class="suppressed">AADL currently owns no copies of this item</div>';
    }
    ?>
      <ul>
        <li class="hitlist-title">
          <?php 
    if ($locum_result['title_medium']) {
        $locum_result['title'] = $locum_result['title'] . ' ' . $locum_result['title_medium'];
    }
    ?>
          <strong><?php 
    print l(title_case($locum_result['title']), $url_prefix . '/record/' . $locum_result['_id'], array('alias' => TRUE, 'html' => TRUE));
    ?>
</strong>
          <?php 
    if ($locum_result['non_romanized_title']) {
        echo " (" . $locum_result['non_romanized_title'] . ")";
    }
    if ($locum_result['pub_year']) {
        ?>
          (<?php 
        echo $locum_result['pub_year'];
        ?>
)<?php 
    }
    ?>
        </li>