示例#1
0
 public static function paginate($page = 1, $perpage = 10)
 {
     $query = Query::table(static::table());
     $count = $query->count();
     $results = $query->take($perpage)->skip(($page - 1) * $perpage)->sort('title')->get();
     return new Paginator($results, $count, $page, $perpage, Uri::to('admin/companies'));
 }
 public static function paginate($page = 1, $perpage = 10)
 {
     $query = Query::table(static::table());
     $count = $query->count();
     $results = $query->take($perpage)->skip(($page - 1) * $perpage)->sort('real_name', 'desc')->get();
     return new Paginator($results, $count, $page, $perpage, Uri::to('users'));
 }
示例#3
0
 public static function link($uri, $title = '', $attributes = array())
 {
     if (strpos('#', $uri) !== 0) {
         $uri = Uri::to($uri);
     }
     if ($title == '') {
         $title = $uri;
     }
     $attributes['href'] = $uri;
     return static::element('a', $title, $attributes);
 }
示例#4
0
文件: edit.php 项目: Rictus/CMS_Prod
<?php

echo $header;
?>

    <form method="post" action="<?php 
echo Uri::to('admin/posts/edit/' . $article->id);
?>
"
          enctype="multipart/form-data" novalidate>

        <input name="token" type="hidden" value="<?php 
echo $token;
?>
">

        <fieldset class="header">
            <div class="wrap">
                <?php 
echo $messages;
?>
            </div>
        </fieldset>

        <fieldset class="main">
            <div class="wrap">
                <?php 
echo Form::text('title', Input::previous('title', $article->title), array('placeholder' => __('posts.title'), 'autocomplete' => 'off', 'autofocus' => 'true'));
?>
                <?php 
echo Form::textarea('html', Input::previous('html', $article->html), array('placeholder' => __('posts.content_explain'), 'class' => 'ckeditorgo'));
示例#5
0
     $vars['messages'] = Notify::read();
     $vars['posts'] = $pagination;
     $vars['category'] = $category;
     $vars['categories'] = Category::sort('title')->get();
     $vars['status'] = 'all';
     return View::create('posts/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
 });
 /*
 	List posts by status and paginate through them
 */
 Route::get(array('admin/posts/status/(:any)', 'admin/posts/status/(:any)/(:num)'), function ($status, $post = 1) {
     $query = Post::where('status', '=', $status);
     $perpage = Config::meta('posts_per_page');
     $total = $query->count();
     $posts = $query->sort('title')->take($perpage)->skip(($post - 1) * $perpage)->get();
     $url = Uri::to('admin/posts/status');
     $pagination = new Paginator($posts, $total, $post, $perpage, $url);
     $vars['messages'] = Notify::read();
     $vars['posts'] = $pagination;
     $vars['status'] = $status;
     $vars['categories'] = Category::sort('title')->get();
     return View::create('posts/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
 });
 /*
 	Edit post
 */
 Route::get('admin/posts/edit/(:num)', function ($id) {
     $vars['messages'] = Notify::read();
     $vars['token'] = Csrf::token();
     $vars['article'] = Post::find($id);
     $vars['page'] = Registry::get('posts_page');
?>

<hgroup class="wrap">
	<h1><?php 
echo __('extend.create_variable');
?>
</h1>
</hgroup>

<section class="wrap">
	<?php 
echo $messages;
?>

	<form method="post" action="<?php 
echo Uri::to('admin/extend/variables/add');
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<p>
				<label><?php 
echo __('extend.name');
?>
:</label>
				<?php 
示例#7
0
文件: edit.php 项目: Rictus/CMS_Prod
?>
"></script>
    <script src="<?php 
echo asset('anchor/views/assets/js/change-saver.js');
?>
"></script>
    <script src="<?php 
echo asset('anchor/views/assets/js/autosave.js');
?>
"></script>
    <script>
        $('textarea[name=markdown]').editor();
        $('#pagetype').on('change', function() {
            var $this = $(this);
            $.post("<?php 
echo Uri::to('admin/get_fields');
?>
", {
                id: <?php 
echo $page->id;
?>
,
                pagetype: $this.val(),
                token: "<?php 
echo $token;
?>
"
            }, function(res){
                res = JSON.parse(res);
                $('#extended-fields').html(res.html);
                $('input[name="token"]').replaceWith(res.token);
示例#8
0
function base_url($url = '')
{
    return Uri::to($url);
}
示例#9
0
echo $header;
?>

<hgroup class="wrap">
	<h1><?php 
echo __('extend.editing_custom_field', $field->label);
?>
</h1>
</hgroup>

<section class="wrap">
	

	<form method="post" action="<?php 
echo Uri::to('admin/extend/fields/edit/' . $field->id);
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<p>
				<label for="label-type"><?php 
echo __('extend.type');
?>
:</label>
				<?php 
示例#10
0
?>

<hgroup class="wrap">
	<h1><?php 
echo __('extend.create_pagetype');
?>
</h1>
</hgroup>

<section class="wrap">
	<?php 
echo $messages;
?>

	<form method="post" action="<?php 
echo Uri::to('admin/extend/pagetypes/add');
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<p>
				<label><?php 
echo __('extend.name');
?>
:</label>
				<?php 
示例#11
0
		<aside class="buttons">
			<?php 
    echo Form::button(__('global.create'), array('class' => 'btn', 'type' => 'submit'));
    ?>

			<?php 
    echo Html::link('admin/users', __('global.cancel'), array('class' => 'btn cancel blue'));
    ?>
		</aside>
	</form>
	<?php 
} else {
    ?>
		<p>You do not have the required privileges to add users, you must be an Administrator. Please contact the Administrator of the site if you are supposed to have these privileges.</p>
		<br><a class="btn" href="<?php 
    echo Uri::to('admin/users');
    ?>
">Go back</a>
	<?php 
}
?>
</section>

<script src="<?php 
echo asset('anchor/views/assets/js/upload-fields.js');
?>
"></script>

<?php 
echo $footer;
     $url = Uri::to('admin/pages');
     $pagination = new Paginator($pages, $total, $page, $perpage, $url);
     $vars['messages'] = Notify::read();
     $vars['pages'] = $pagination;
     $vars['status'] = 'all';
     return View::create('pages/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
 });
 /*
 	List pages by status and paginate through them
 */
 Route::get(array('admin/pages/status/(:any)', 'admin/pages/status/(:any)/(:num)'), function ($status, $page = 1) {
     $query = Page::where('status', '=', $status);
     $perpage = Config::meta('posts_per_page');
     $total = $query->count();
     $pages = $query->sort('title')->take($perpage)->skip(($page - 1) * $perpage)->get();
     $url = Uri::to('admin/pages/status');
     $pagination = new Paginator($pages, $total, $page, $perpage, $url);
     $vars['messages'] = Notify::read();
     $vars['pages'] = $pagination;
     $vars['status'] = $status;
     return View::create('pages/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
 });
 /*
 	Edit Page
 */
 Route::get('admin/pages/edit/(:num)', function ($id) {
     $vars['messages'] = Notify::read();
     $vars['token'] = Csrf::token();
     $vars['page'] = Page::find($id);
     $vars['pages'] = Page::dropdown(array('exclude' => array($id), 'show_empty_option' => true));
     $vars['statuses'] = array('published' => __('global.published'), 'draft' => __('global.draft'), 'archived' => __('global.archived'));
示例#13
0
			<?php 
echo Form::text('user', $user, array('id' => 'label-user', 'autocapitalize' => 'off', 'autofocus' => 'true', 'placeholder' => __('users.username')));
?>
</p>

			<p><label for="label-pass"><?php 
echo __('users.password');
?>
:</label>
			<?php 
echo Form::password('pass', array('id' => 'pass', 'placeholder' => __('users.password'), 'autocomplete' => 'off'));
?>
</p>

			<p class="buttons"><a href="<?php 
echo Uri::to('admin/amnesia');
?>
"><?php 
echo __('users.forgotten_password');
?>
</a>
			<button type="submit"><?php 
echo __('global.login');
?>
</button></p>
		</fieldset>
	</form>

</section>

<?php 
示例#14
0
文件: comments.php 项目: silviuu/blg
function comment_form_url()
{
    return Uri::to(Uri::current());
}
示例#15
0
文件: add.php 项目: Rictus/CMS_Prod
<?php

echo $header;
?>

    <form method="post" action="<?php 
echo Uri::to('admin/pages/add');
?>
" enctype="multipart/form-data" novalidate>

        <input name="token" type="hidden" value="<?php 
echo $token;
?>
">

        <fieldset class="header">
            <div class="wrap">
                <?php 
echo $messages;
?>

                <?php 
echo Form::text('title', Input::previous('title'), array('placeholder' => __('pages.title'), 'autocomplete' => 'off', 'autofocus' => 'true'));
?>

                <aside class="buttons">
                    <?php 
echo Form::button(__('global.save'), array('type' => 'submit', 'class' => 'btn'));
?>

                    <?php 
示例#16
0
	</nav>

</hgroup>

<section class="wrap">
	<?php 
echo $messages;
?>

	<ul class="list">
		<?php 
foreach ($companies->results as $company) {
    ?>
             <li>
             	<a href="<?php 
    echo Uri::to('admin/companies/edit/' . $company->id);
    ?>
">
             	<strong><?php 
    echo $company->title;
    ?>
</strong>

             	<span><?php 
    echo $company->slug;
    ?>
</span>
             </li>
		<?php 
}
?>
示例#17
0
?>

<hgroup class="wrap">
	<h1><?php 
echo __('categories.edit_category', $category->title);
?>
</h1>
</hgroup>

<section class="wrap">
	<?php 
echo $messages;
?>

	<form method="post" action="<?php 
echo Uri::to('admin/categories/edit/' . $category->id);
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<p>
				<label for="label-title"><?php 
echo __('categories.title');
?>
:</label>
				<?php 
示例#18
0
文件: edit.php 项目: Rictus/CMS_Prod
<?php

echo $header;
foreach ($fields as $field) {
    switch ($field->key) {
        case 'targetlanguage':
            $targetLanguage = $field;
            break;
        default:
            break;
    }
}
?>

    <form method="post" action="<?php 
echo Uri::to('admin/blog/edit/' . $post->id);
?>
"
          enctype="multipart/form-data" novalidate>

        <input name="token" type="hidden" value="<?php 
echo $token;
?>
">

        <fieldset class="header">
            <div class="wrap">
                <?php 
echo $messages;
?>
            </div>
示例#19
0
echo $header;
?>

<hgroup class="wrap">
	<h1><?php 
echo __('metadata.metadata');
?>
</h1>
</hgroup>

<section class="wrap">
	

	<form method="post" action="<?php 
echo Uri::to('admin/extend/metadata');
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<legend>Admin Settings</legend>
			<p>
				<label for="label-dashboard_page"><?php 
echo __('metadata.dashboard_page', 'Dashboard page');
?>
</label>
示例#20
0
文件: add.php 项目: pepfi/anchor-cms
<hgroup class="wrap">
	
	<h1><?php 
echo __('departments.create_department');
?>
</h1>
</hgroup>

<session class="wrap">
	<?php 
echo $messages;
?>

	<form method="post" action="<?php 
echo Uri::to('admin/departments/add');
?>
">
         <input name="token" type="hidden" value="<?php 
echo $token;
?>
">

         <fieldset class="split">
         	<p>
         		<label for="label-title">
         			<?php 
echo __('departments.title');
?>
:
         		</label>
示例#21
0
    ?>
		<?php 
}
?>
	</nav>

	<?php 
if ($comments->count) {
    ?>
	<ul class="main list">
		<?php 
    foreach ($comments->results as $comment) {
        ?>
		<li>
			<a href="<?php 
        echo Uri::to('admin/comments/edit/' . $comment->id);
        ?>
">
				<strong><?php 
        echo strip_tags($comment->text);
        ?>
</strong>
				<span><time><?php 
        echo Date::format($comment->date);
        ?>
</time></span>
				<span class="highlight"><?php 
        echo __('global.' . $comment->status);
        ?>
</span>
			</a>
 public function uri()
 {
     return Uri::to($this->relative_uri());
 }
示例#23
0
	</nav>
</hgroup>

<section class="wrap">
	

	<?php 
if (count($variables)) {
    ?>
	<ul class="list">
		<?php 
    foreach ($variables as $var) {
        ?>
		<li>
			<a href="<?php 
        echo Uri::to('admin/extend/variables/edit/' . $var->key);
        ?>
">
				<strong><?php 
        echo substr($var->key, strlen('custom_'));
        ?>
</strong>
				<p><?php 
        echo e($var->value);
        ?>
</p>
			</a>
		</li>
		<?php 
    }
    ?>
示例#24
0
}
?>
    <link rel="stylesheet" href=<?php 
echo "/themes/default/css/main_overwrite.css";
?>
>
</head>
<body class="<?php 
echo body_class();
?>
">
<div class="main-wrap">
    <header id="top">
        <div class="logo">
            <a class="logo-img" href="<?php 
echo Uri::to('/');
?>
">
                <img src="<?php 
echo asset_url('/img/CETI.png');
?>
"
                     alt="Logo du site de Ronald Virag">
            </a>

            <div class="headline"><?php 
echo $headline[0];
?>
                <div class="underHeadline"><?php 
echo $headline[1];
?>
示例#25
0
    ?>
					</ul>
				</nav>

				<?php 
    echo Html::link('admin/logout', __('global.logout'), array('class' => 'btn'));
    ?>

				<?php 
    $home = Registry::get('home_page');
    ?>

				<?php 
    echo Html::link($home->slug, __('global.visit_your_site'), array('class' => 'btn', 'target' => '_blank'));
    ?>

				<?php 
} else {
    ?>
				<aside class="logo">
					<a href="<?php 
    echo Uri::to('admin/login');
    ?>
">Anchor CMS</a>
				</aside>
				<?php 
}
?>
			</div>
		</header>
示例#26
0
文件: index.php 项目: Rictus/CMS_Prod
    <section class="wrap">
        <hgroup class="wrap">
            <h1>Votre équipe</h1>
            <nav>
                <?php 
echo Html::link('admin/accueil/addTeamMember', __('accueil.create_teamMember'), array('class' => 'btn'));
?>
            </nav>
        </hgroup>
        <ul class="main list">
            <?php 
foreach ($team as $member) {
    ?>
                <li>
                    <a href="<?php 
    echo Uri::to('admin/accueil/editTeamMember/' . $member->id);
    ?>
">
                        <strong><?php 
    echo $member->teammembername;
    ?>
</strong>

                        <p>
                            <?php 
    echo $member->teammemberjob;
    ?>
                        </p>

                        <p>
                            <?php 
示例#27
0
        case 'teammembername':
            $teamMemberName = $field;
            break;
        case 'teammemberjob':
            $teamMemberJob = $field;
            break;
        case 'teammemberjob_en':
            $teamMemberJob_en = $field;
            break;
        default:
            break;
    }
}
?>
    <form method="post" action="<?php 
echo Uri::to('admin/accueil/addTeamMember');
?>
" enctype="multipart/form-data"
          novalidate>
        <input name="token" type="hidden" value="<?php 
echo $token;
?>
">
        <fieldset class="header">
            <div class="wrap">
                <?php 
echo $messages;
?>
            </div>
        </fieldset>
示例#28
0
?>

<hgroup class="wrap">
	<h1><?php 
echo __('extend.editing_pagetype', $pagetype->key);
?>
</h1>
</hgroup>

<section class="wrap">
	<?php 
echo $messages;
?>

	<form method="post" action="<?php 
echo Uri::to('admin/extend/pagetypes/edit/' . $pagetype->key);
?>
" novalidate>

		<input name="token" type="hidden" value="<?php 
echo $token;
?>
">

		<fieldset class="split">
			<p>
				<label><?php 
echo __('extend.name');
?>
:</label>
				<?php 
    ?>
		<?php 
}
?>
	</nav>

	<?php 
if ($pages->count) {
    ?>
	<ul class="main list">
		<?php 
    foreach ($pages->results as $page) {
        ?>
		<li>
			<a href="<?php 
        echo Uri::to('admin/pages/edit/' . $page->id);
        ?>
">
				<strong><?php 
        echo $page->name;
        ?>
</strong>

				<span>
					<?php 
        echo $page->slug;
        ?>

					<em class="status <?php 
        echo $page->status;
        ?>
示例#30
0
?>
</section>

<script src="<?php 
echo asset('anchor/views/assets/js/sortable.js');
?>
"></script>
<script>
	$('.sortable').sortable({
		element: 'li',
		dropped: function() {
			var data = {sort: []};

			$('.sortable span').each(function(index, item) {
				data.sort.push($(item).data('id'));
			});

			$.ajax({
				'type': 'POST',
				'url': '<?php 
echo Uri::to("admin/menu/update");
?>
',
				'data': $.param(data)
			});
		}
	});
</script>

<?php 
echo $footer;