auth->makePermissions([dcAuth::PERMISSION_ADMIN])); $o = new dcAliases(); $aliases = $o->getAliases(); # Update aliases if (isset($_POST['a']) && is_array($_POST['a'])) { try { $o->updateAliases($_POST['a']); http::redirect(dcCore::app()->admin->getPageURL() . '&up=1'); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } # New alias if (isset($_POST['alias_url'])) { try { $o->createAlias($_POST['alias_url'], $_POST['alias_destination'], count($aliases) + 1); http::redirect(dcCore::app()->admin->getPageURL() . '&created=1'); } catch (Exception $e) { dcCore::app()->error->add($e->getMessage()); } } ?> <?php echo __('Aliases'); ?> ' . html::escapeHTML(dcCore::app()->blog->name) . ' › ' . __('Aliases') . '' . '

' . __('Aliases list') . '

'; if (empty($aliases)) { echo '

' . __('No alias') . '

'; } else { echo '
' . '' . '' . '' . '' . ''; foreach ($aliases as $k => $v) { echo '' . '' . '' . '' . ''; } echo '
' . __('Alias URL') . '' . __('Alias destination') . '' . __('Alias position') . '
' . form::field(['a[' . $k . '][alias_url]'], 30, 255, html::escapeHTML($v['alias_url'])) . '' . form::field(['a[' . $k . '][alias_destination]'], 50, 255, html::escapeHTML($v['alias_destination'])) . '' . form::field(['a[' . $k . '][alias_position]'], 3, 5, html::escapeHTML($v['alias_position'])) . '
' . '

' . __('To remove an alias, empty its URL or destination.') . '

' . '

' . dcCore::app()->formNonce() . '

' . '
'; } echo '

' . __('New alias') . '

' . '
' . '

' . '

' . '

' . dcCore::app()->formNonce() . '

' . '
'; dcPage::helpBlock('alias'); ?>