public static function scripts($load = array()) { $string = ''; $autocomplete = 'autocomplete.js'; $date = 'datepicker/bootstrap-datepicker.js'; foreach ($load as $scripts => $script) { $string .= Html::script('assets/js/' . ${$scripts}); } $string .= '<script language="javascript" type="text/javascript">$(document).ready(function() {'; if (array_key_exists('autocomplete', $load)) { $selector = $load['autocomplete']; $string .= '$("#' . $selector . '").autocomplete();'; } if (array_key_exists('date', $load)) { $date = explode('|', $load['date']); foreach ($date as $selector) { $string .= ' $("#' . $selector . '").datepicker({ format: "yyyy/mm/dd", todayBtn: "linked", autoclose: true }); '; } } $string .= '}); </script>'; return $string; }
/** * @param string $url * @param string $name * @param string $position * @param array $attributes * * @return $this */ public function link($url, $name, $position = "BL", $attributes = array()) { $match_url = trim(parse_url($url, PHP_URL_PATH), '/'); if (Request::path() != $match_url) { $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY)); } $attributes = array_merge(array("class" => "btn btn-default"), $attributes); $this->button_container[$position][] = HTML::link($url, $name, $attributes); $this->links[] = $url; return $this; }
/** * @param string $url * @param string $name * @param string $position * @param array $attributes * * @return $this */ public function link($url, $name, $position = "BL", $attributes = array()) { $base = str_replace(Request::path(), '', strtok(Request::fullUrl(), '?')); $match_url = str_replace($base, '/', strtok($url, '?')); if (Request::path() != $match_url) { $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY)); } $attributes = array_merge(array("class" => "btn btn-default"), $attributes); $this->button_container[$position][] = HTML::link($url, $name, $attributes); $this->links[] = $url; return $this; }
public static function styles($demo = false) { $buffer = "\n"; //css links foreach (self::$css as $item) { $buffer .= HTML::style($item); } if ($demo) { $buffer .= HTML::style('packages/zofe/rapyd/assets/demo/style.css'); } //inline styles if (count(self::$styles)) { $buffer .= sprintf("<style type=\"text/css\">\n%s\n</style>", implode("\n", self::$styles)); } return $buffer; }
/** * This adds the necessary classes to chunk HTML for them to be picked up by the JS editor. * i.e. it makes chunks editable. * * @param string $html HTML to add classes to. * * @return string */ public function addAttributesToHtml($html) { $html = trim((string) $html); $attributes = array_merge($this->getRequiredAttributes(), $this->attributes()); $attributesString = Html::attributes($attributes); return preg_replace('|<(.*?)>|', "<\$1{$attributesString}>", $html, 1); }
/** * Get a HTML link to the given category. * * @param \App\Category $category * * @return string */ protected function getCategoryLink(Category $category) { return HTML::linkRoute('tricks.browse.category', $category->name, [$category->slug]); }
public function getInfo() { return HtmlFacade::image(url('images/small/' . $this->thumbnail), $this->caption, array('class' => '')); }
public static function scripts() { $scripts = ''; $scripts .= HTML::script('jmedia/assets/js/jquery.knob.js'); $scripts .= HTML::script('jmedia/assets/js/jquery.ui.widget.js'); $scripts .= HTML::script('jmedia/assets/js/jquery.iframe-transport.js'); $scripts .= HTML::script('jmedia/assets/js/jquery.fileupload.js'); $scripts .= HTML::script('jmedia/assets/js/script.js'); $scripts .= '<script type="text/javascript">$("#delbtn").click(function(e){ var data = { ref : $("#delbtn").attr("data-del"), _token : "' . csrf_token() . '" }; var conf = confirm("Sure you want to delete?"); if(conf){ $.ajax({ url: "' . self::$upload_route . '/delete", data: data, method: "POST", beforeSend: function( xhr ) { xhr.overrideMimeType( "text/plain; charset=x-user-defined" ); } }) .done(function( response ) { $("#photoInfo").modal("hide"); $("img[data-ref="+data.ref+"]").parent().remove(); }); } });</script>'; return $scripts; }
/** * Show the specified user. * * @param int $id * * @return \Illuminate\View\View */ public function show($id) { $user = UserRepository::find($id); $this->checkUser($user); if ($user->activated_at) { $activated = HTML::ago($user->activated_at); } else { if (Credentials::hasAccess('admin') && Config::get('credentials.activation')) { $activated = 'No - <a href="#resend_user" data-toggle="modal" data-target="#resend_user">Resend Email</a>'; } else { $activated = 'Not Activated'; } } if (Credentials::getThrottleProvider()->findByUserId($id)->isSuspended()) { $suspended = 'Currently Suspended'; } else { $suspended = 'Not Suspended'; } $groups = $user->getGroups(); if (count($groups) >= 1) { $data = []; foreach ($groups as $group) { $data[] = $group->name; } $groups = implode(', ', $data); } else { $groups = 'No Group Memberships'; } return View::make('users.show', compact('user', 'groups', 'activated', 'suspended')); }