getAuthPassword());
});
/*
* Some macros and blade extensions
*/
Form::macro('rawLabel', function ($name, $value = null, $options = []) {
$label = Form::label($name, '%s', $options);
return sprintf($label, $value);
});
Form::macro('labelWithHelp', function ($name, $value, $options, $help_text) {
$label = Form::label($name, '%s', $options);
return sprintf($label, $value)
. ''
. ''
. '';
});
Form::macro('customCheckbox', function ($name, $value, $checked = false, $label = false, $options = []) {
// $checkbox = Form::checkbox($name, $value = null, $checked, $options);
// $label = Form::rawLabel();
//
// $out = '
//
//
//
';
//
// return $out;
});
Form::macro('styledFile', function ($name, $multiple = false) {
$out = '';
return $out;
});
HTML::macro('sortable_link',
function ($title, $active_sort, $sort_by, $sort_order, $url_params = [], $class = '', $extra = '') {
$sort_order = $sort_order == 'asc' ? 'desc' : 'asc';
$url_params = http_build_query([
'sort_by' => $sort_by,
'sort_order' => $sort_order,
] + $url_params);
$html = "";
$html .= ($active_sort == $sort_by) ? "$title" : $title;
$html .= ($sort_order == 'desc') ? '' : '';
$html .= '';
return $html;
});
HTML::macro('cat_menu', function ($categories = array(), $class = '',$item_class = '',$options = array()){
$html = "html->attributes($options)}>";
foreach($categories as $category){
$html.= "- {$category}
";
}
$html.="
";
return $html;
});
Blade::directive('money', function ($expression) {
return "";
});
Form::macro('subSelect', function($name, $list = array(), $selected = null, $options = array())
{
$selected = $this->getValueAttribute($name, $selected);
$options['id'] = $this->getIdAttribute($name, $options);
if ( ! isset($options['name'])) $options['name'] = $name;
$html = array('');
//dd($list);
foreach ($list as $list_el)
{
$selectedAttribute = $this->getSelectedValue($list_el['id'], $selected);
// dd($selectedAttribute);
$option_attr = array('value' => e($list_el['id']), 'selected' => $selectedAttribute, 'parent' => $list_el['parent_id']);
$html[] = '';
}
$options = $this->html->attributes($options);
$list = implode('', $html);
return "";
});