2018-04-22 17:45:31 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo Bootstrap::pageTitle(array('title'=>$L->g('Settings'), 'icon'=>'cog'));
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!-- TABS -->
|
|
|
|
<ul class="nav nav-tabs" id="dynamicTab" role="tablist">
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link active" id="general-tab" data-toggle="tab" href="#general" role="tab" aria-controls="general" aria-selected="true">General</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link " id="advanced-tab" data-toggle="tab" href="#advanced" role="tab" aria-controls="advanced" aria-selected="false">Advanced</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link " id="social-tab" data-toggle="tab" href="#social" role="tab" aria-controls="social" aria-selected="false">Social Networks</a>
|
|
|
|
</li>
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" id="language-tab" data-toggle="tab" href="#language" role="tab" aria-controls="language" aria-selected="false">Language</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2018-04-27 20:36:43 +02:00
|
|
|
<?php
|
|
|
|
echo Bootstrap::formOpen(array(
|
|
|
|
'id'=>'dynamicTabContent',
|
2018-05-08 00:15:40 +02:00
|
|
|
'class'=>'tab-content mt-4'
|
2018-04-27 20:36:43 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
// Token CSRF
|
|
|
|
echo Bootstrap::formInputHidden(array(
|
|
|
|
'name'=>'tokenCSRF',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$security->getTokenCSRF()
|
2018-04-27 20:36:43 +02:00
|
|
|
));
|
|
|
|
?>
|
2018-04-22 17:45:31 +02:00
|
|
|
|
|
|
|
<!-- TABS GENERAL -->
|
|
|
|
<div class="tab-pane show active" id="general" role="tabpanel" aria-labelledby="general-tab">
|
|
|
|
<?php
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'title',
|
|
|
|
'label'=>$L->g('Site title'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->title(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('use-this-field-to-name-your-site')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'slogan',
|
|
|
|
'label'=>$L->g('Site slogan'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->slogan(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('use-this-field-to-add-a-catchy-phrase')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'description',
|
|
|
|
'label'=>$L->g('Site description'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->description(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('you-can-add-a-site-description-to-provide')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'footer',
|
|
|
|
'label'=>$L->g('Footer text'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->footer(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('you-can-add-a-small-text-on-the-bottom')
|
|
|
|
));
|
2018-04-27 20:36:43 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<div class="form-group mt-4">
|
|
|
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
|
|
|
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'dashboard" role="button">'.$L->g('Cancel').'</a>
|
|
|
|
</div>
|
|
|
|
';
|
2018-04-22 17:45:31 +02:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- TABS ADVANCED -->
|
|
|
|
<div class="tab-pane" id="advanced" role="tabpanel" aria-labelledby="advanced-tab">
|
|
|
|
<?php
|
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Content')));
|
|
|
|
|
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'itemsPerPage',
|
|
|
|
'label'=>$L->g('Items per page'),
|
|
|
|
'options'=>array('1'=>'1','2'=>'2','3'=>'3','4'=>'4','5'=>'5','6'=>'6','7'=>'7','8'=>'8', '-1'=>$L->g('All content')),
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->itemsPerPage(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'tip'=>$L->g('Number of items to show per page')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'orderBy',
|
|
|
|
'label'=>$L->g('Order content by'),
|
|
|
|
'options'=>array('date'=>$L->g('Date'),'position'=>$L->g('Position')),
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->orderBy(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'tip'=>$L->g('order-the-content-by-date-to-build-a-blog')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Predefined pages')));
|
|
|
|
|
2018-05-14 00:00:10 +02:00
|
|
|
echo Bootstrap::formInputText(array(
|
2018-04-22 17:45:31 +02:00
|
|
|
'name'=>'homepage',
|
|
|
|
'label'=>$L->g('Homepage'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>(Text::isEmpty($site->homepage())?'':$site->homepage()),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
2018-05-14 00:00:10 +02:00
|
|
|
'placeholder'=>'Start writing the title of the page',
|
2018-04-22 17:45:31 +02:00
|
|
|
'tip'=>$L->g('Returning page for the main page')
|
|
|
|
));
|
|
|
|
|
|
|
|
$homepageOptions[' '] = '- '.$L->g('Default message').' -';
|
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'pageNotFound',
|
|
|
|
'label'=>$L->g('Page not found'),
|
|
|
|
'options'=>$homepageOptions,
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->pageNotFound(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'tip'=>$L->g('Returning page when the page doesnt exist')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Email account settings')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'emailFrom',
|
|
|
|
'label'=>$L->g('Sender email'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->emailFrom(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('Emails will be sent from this address')
|
|
|
|
));
|
|
|
|
|
2018-07-07 12:04:34 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Autosave')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'autosaveInterval',
|
|
|
|
'label'=>$L->g('Interval'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->autosaveInterval(),
|
2018-07-07 12:04:34 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('Number in minutes for every execution of autosave')
|
|
|
|
));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Site URL')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'url',
|
2018-04-27 20:36:43 +02:00
|
|
|
'label'=>'URL',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->url(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('full-url-of-your-site'),
|
|
|
|
'placeholder'=>'https://'
|
|
|
|
));
|
|
|
|
|
2018-04-27 20:36:43 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Extreme friendly URL')));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'extremeFriendly',
|
2018-04-27 20:36:43 +02:00
|
|
|
'label'=>'Allow Unicode',
|
2018-04-22 17:45:31 +02:00
|
|
|
'options'=>array('true'=>'Enabled', 'false'=>'Disable'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->extremeFriendly(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
2018-04-27 20:36:43 +02:00
|
|
|
'tip'=>'Allow unicode characters in the URL and some part of the system.'
|
2018-04-22 17:45:31 +02:00
|
|
|
));
|
|
|
|
|
2018-07-13 18:30:42 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Title formats')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'titleFormatHomepage',
|
|
|
|
'label'=>'Homepage',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->titleFormatHomepage(),
|
2018-07-13 18:30:42 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>'Variables allowed: <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
|
|
|
|
'placeholder'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'titleFormatPages',
|
|
|
|
'label'=>'Pages',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->titleFormatPages(),
|
2018-07-13 18:30:42 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>'Variables allowed: <code>{{page-title}}</code> <code>{{page-description}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
|
|
|
|
'placeholder'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'titleFormatCategory',
|
|
|
|
'label'=>'Category',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->titleFormatCategory(),
|
2018-07-13 18:30:42 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>'Variables allowed: <code>{{category-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
|
|
|
|
'placeholder'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'titleFormatTag',
|
|
|
|
'label'=>'Tag',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->titleFormatTag(),
|
2018-07-13 18:30:42 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>'Variables allowed: <code>{{tag-name}}</code> <code>{{site-title}}</code> <code>{{site-slogan}}</code> <code>{{site-description}}</code>',
|
|
|
|
'placeholder'=>''
|
|
|
|
));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('URL Filters')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'uriPage',
|
|
|
|
'label'=>$L->g('Pages'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->uriFilters('page'),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>DOMAIN_PAGES
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'uriTag',
|
|
|
|
'label'=>$L->g('Tags'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->uriFilters('tag'),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>DOMAIN_TAGS
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'uriCategory',
|
|
|
|
'label'=>$L->g('Category'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->uriFilters('category'),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>DOMAIN_CATEGORIES
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'uriBlog',
|
|
|
|
'label'=>$L->g('Blog'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->uriFilters('blog'),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
2018-07-17 19:13:01 +02:00
|
|
|
'tip'=>DOMAIN.$site->uriFilters('blog'),
|
|
|
|
'disabled'=>!$site->uriFilters('blog')
|
2018-04-22 17:45:31 +02:00
|
|
|
));
|
2018-04-27 20:36:43 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<div class="form-group mt-4">
|
|
|
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
|
|
|
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'dashboard" role="button">'.$L->g('Cancel').'</a>
|
|
|
|
</div>
|
|
|
|
';
|
2018-04-22 17:45:31 +02:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- TABS SOCIAL NETWORKS -->
|
|
|
|
<div class="tab-pane" id="social" role="tabpanel" aria-labelledby="social-tab">
|
|
|
|
<?php
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'twitter',
|
|
|
|
'label'=>'Twitter',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->twitter(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'facebook',
|
|
|
|
'label'=>'Facebook',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->facebook(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'codepen',
|
|
|
|
'label'=>'Codepen',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->codepen(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'googlePlus',
|
|
|
|
'label'=>'Google+',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->googlePlus(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'instagram',
|
|
|
|
'label'=>'Instagram',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->instagram(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2018-06-24 13:37:45 +02:00
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'gitlab',
|
|
|
|
'label'=>'Gitlab',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->gitlab(),
|
2018-06-24 13:37:45 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
2018-04-22 17:45:31 +02:00
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'github',
|
|
|
|
'label'=>'Github',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->github(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'linkedin',
|
|
|
|
'label'=>'Linkedin',
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->linkedin(),
|
2018-04-22 17:45:31 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>''
|
|
|
|
));
|
2018-04-27 20:36:43 +02:00
|
|
|
|
|
|
|
echo '
|
|
|
|
<div class="form-group mt-4">
|
|
|
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
|
|
|
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'dashboard" role="button">'.$L->g('Cancel').'</a>
|
|
|
|
</div>
|
|
|
|
';
|
2018-04-22 17:45:31 +02:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- TABS TIMEZONE AND LANGUAGES -->
|
|
|
|
<div class="tab-pane" id="language" role="tabpanel" aria-labelledby="language-tab">
|
2018-04-27 20:36:43 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'language',
|
|
|
|
'label'=>$L->g('Language'),
|
|
|
|
'options'=>$Language->getLanguageList(),
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->language(),
|
2018-04-27 20:36:43 +02:00
|
|
|
'class'=>'',
|
|
|
|
'tip'=>$L->g('select-your-sites-language')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formSelect(array(
|
|
|
|
'name'=>'timezone',
|
|
|
|
'label'=>$L->g('Timezone'),
|
|
|
|
'options'=>Date::timezoneList(),
|
2018-07-17 19:13:01 +02:00
|
|
|
'selected'=>$site->timezone(),
|
2018-04-27 20:36:43 +02:00
|
|
|
'class'=>'',
|
|
|
|
'tip'=>$L->g('select-a-timezone-for-a-correct')
|
|
|
|
));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'locale',
|
|
|
|
'label'=>$L->g('Locale'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->locale(),
|
2018-04-27 20:36:43 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
|
|
|
'tip'=>$L->g('with-the-locales-you-can-set-the-regional-user-interface')
|
|
|
|
));
|
2018-04-22 17:45:31 +02:00
|
|
|
|
2018-04-27 20:36:43 +02:00
|
|
|
echo Bootstrap::formTitle(array('title'=>$L->g('Date and time formats')));
|
|
|
|
|
|
|
|
echo Bootstrap::formInputText(array(
|
|
|
|
'name'=>'dateFormat',
|
|
|
|
'label'=>$L->g('Date format'),
|
2018-07-17 19:13:01 +02:00
|
|
|
'value'=>$site->dateFormat(),
|
2018-04-27 20:36:43 +02:00
|
|
|
'class'=>'',
|
|
|
|
'placeholder'=>'',
|
2018-07-17 19:13:01 +02:00
|
|
|
'tip'=>$L->g('Current format').': '.Date::current($site->dateFormat())
|
2018-04-27 20:36:43 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
echo '
|
|
|
|
<div class="form-group mt-4">
|
|
|
|
<button type="submit" class="btn btn-primary mr-2" name="save">'.$L->g('Save').'</button>
|
|
|
|
<a class="btn btn-secondary" href="'.HTML_PATH_ADMIN_ROOT.'dashboard" role="button">'.$L->g('Cancel').'</a>
|
|
|
|
</div>
|
|
|
|
';
|
|
|
|
?>
|
2018-04-22 17:45:31 +02:00
|
|
|
</div>
|
2018-04-27 20:36:43 +02:00
|
|
|
<?php
|
|
|
|
echo Bootstrap::formClose();
|
2018-05-14 00:00:10 +02:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
|
|
// Parent autocomplete
|
|
|
|
var homepageXHR;
|
|
|
|
var homepageList; // Keep the parent list returned to get the key by the title page
|
|
|
|
$("#jshomepage").autoComplete({
|
|
|
|
minChars: 1,
|
|
|
|
source: function(term, response) {
|
|
|
|
// Prevent call inmediatly another ajax request
|
|
|
|
try { homepageXHR.abort(); } catch(e){}
|
|
|
|
homepageXHR = $.getJSON(HTML_PATH_ADMIN_ROOT+"ajax/get-published", {query: term},
|
|
|
|
function(data) {
|
|
|
|
homepageList = data;
|
|
|
|
term = term.toLowerCase();
|
|
|
|
var matches = [];
|
|
|
|
for (var title in data) {
|
|
|
|
if (~title.toLowerCase().indexOf(term))
|
|
|
|
matches.push(title);
|
|
|
|
}
|
|
|
|
response(matches);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
onSelect: function(e, term, item) {
|
|
|
|
// homepageList = array( pageTitle => pageKey )
|
|
|
|
var pageKey = homepageList[term];
|
|
|
|
$("#jsparent").attr("value", pageKey);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$("#jshomepage").change(function() {
|
|
|
|
if ($(this).val()) {
|
|
|
|
$("#jsuriBlog").removeAttr('disabled');
|
|
|
|
$("#jsuriBlog").attr('value', '/blog/');
|
|
|
|
} else {
|
|
|
|
$("#jsuriBlog").attr('value', '');
|
|
|
|
$("#jsuriBlog").attr('disabled', 'disabled');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2018-06-24 13:37:45 +02:00
|
|
|
</script>
|