Ejemplo n.º 1
0
Archivo: edit.php Proyecto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

<fieldset>
	<?php 
        echo Form::input_wrap('name', $this->blog_entry->name, array('class' => 'input-lg', 'placeholder' => __('Title')), null, Arr::get($this->errors, 'name'));
        ?>

	<?php 
        echo Form::textarea_wrap('content', $this->blog_entry->content, array('class' => 'input-lg', 'placeholder' => __('Content')), true, null, Arr::get($this->errors, 'content'), null, true);
        ?>
</fieldset>

<fieldset>
	<?php 
        echo Form::csrf();
        ?>
	<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg'));
        ?>
	<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 2
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo $this->message;
        echo Form::open();
        echo Form::input_wrap('email', $this->email, array('type' => 'email', 'required', 'class' => 'input-lg', 'placeholder' => __('Username or email')), __('Send a new password to'), null, __('We will send you a "new" password generated from the hash of your current, forgotten password.') . '<br><em>' . __('Please change your password after signing in!') . '</em>');
        echo Form::button(null, '<i class="fa fa-envelope"></i> ' . __('Send'), array('class' => 'btn btn-primary'));
        echo Form::close();
        ?>

<hr />

<blockquote cite="http://dilbert.com/strips/comic/1996-09-05/">
	<dl class="dl-horizontal">
		<dt>Asok:</dt> <dd>I have forgotten my password. I humbly beg for assistance.</dd>
		<dt>Dogbert:</dt> <dd>I have no time for boring administrative tasks, you fool! I'm too busy upgrading the network.</dd>
		<dt>Asok:</dt> <dd>You could have given me a new password in the time it took to belittle me.</dd>
		<dt>Dogbert:</dt> <dd>Yeah, but which option would give me job satisfaction?</dd>
	</dl>
	<small class="pull-right"><a href="http://dilbert.com/strips/comic/1996-09-05/">Dilbert</a></small>
</blockquote>

<?php 
        return ob_get_clean();
    }
Ejemplo n.º 3
0
Archivo: signin.php Proyecto: anqh/anqh
 /**
  * Get form.
  *
  * @return  string
  */
 public static function form()
 {
     ob_start();
     echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), '&nbsp;<i class="fa fa-facebook"></i> ' . __('Connect with Facebook') . '&nbsp;', array('class' => 'btn btn-block btn-facebook', 'title' => __('Sign in with your Facebook account')));
     echo '<hr>';
     echo Form::open(Route::url('sign', array('action' => 'in')));
     echo Form::input_wrap('username', null, array('autofocus'), __('Username or email'));
     echo Form::password_wrap('password', null, null, __('Password') . ' &nbsp; ' . HTML::anchor(Route::url('sign', array('action' => 'password')), __('Forgot?'), array('class' => 'text-muted')));
     echo Form::form_group(Form::checkbox_wrap('remember', 'true', true, null, __('Stay logged in')));
     echo Form::button(null, __('Login'), array('class' => 'btn btn-block btn-primary', 'title' => __('Remember to sign out if on a public computer!')));
     echo Form::close();
     return ob_get_clean();
 }
Ejemplo n.º 4
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open(null, array('autocomplete' => 'off'));
        ?>

<fieldset>
	<legend><?php 
        echo __('Almost there!');
        ?>
</legend>

	<?php 
        echo Form::input_wrap('username', $this->user->username, array('class' => 'input-lg', 'placeholder' => __('JohnDoe'), 'required'), __('Username'), Arr::get($this->errors, 'username'), __('Choose a unique username with at least <var>:length</var> characters. No special characters, thank you.', array(':length' => Kohana::$config->load('visitor.username.length_min'))));
        ?>

	<?php 
        echo Form::password_wrap('password', null, array('class' => 'input-lg', 'required'), __('Password'), Arr::get($this->errors, 'password'), __('Try to use letters, numbers and special characters for a stronger password, with at least <var>8</var> characters.'));
        ?>

	<?php 
        echo Form::input_wrap('email', $this->user->email, array('class' => 'input-lg', 'type' => 'email', 'disabled', 'placeholder' => __('*****@*****.**')), __('Email'), Arr::get($this->errors, 'email'));
        ?>

</fieldset>

<fieldset>
	<?php 
        echo Form::hidden('code', $this->code);
        ?>
	<?php 
        echo Form::button('register', __('Sign up!'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg'));
        ?>
	<?php 
        echo HTML::anchor(Request::back('/', true), __('Cancel'), array('class' => 'cancel'));
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 5
0
Archivo: form.php Proyecto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

<div class="row">
	<fieldset class="col-sm-6">

		<?php 
        echo Form::input_wrap('name', $this->name, null, __('Name'), Arr::get($this->errors, 'name'));
        ?>

		<?php 
        echo Form::input_wrap('email', $this->email, array('type' => 'email'), __('Email'), Arr::get($this->errors, 'email'));
        ?>

		<?php 
        echo Form::input_wrap('subject', $this->subject, null, __('Subject'), Arr::get($this->errors, 'subject'));
        ?>

		<?php 
        echo Form::textarea_wrap('content', $this->content, null, true, __('Content'), Arr::get($this->errors, 'content'));
        ?>

	</fieldset>
</div>

<fieldset>
	<?php 
        echo Form::csrf();
        ?>
	<?php 
        echo Form::button('save', __('Send'), array('type' => 'submit', 'class' => 'btn btn-primary btn-lg'));
        ?>
</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 6
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        ?>

	<fieldset>

		<?php 
        echo Form::input_wrap('name', $this->group->name, null, __('Name'), Arr::get($this->errors, 'name'));
        ?>

		<?php 
        echo Form::input_wrap('description', $this->group->description, null, __('Description'), Arr::get($this->errors, 'description'));
        ?>

		<?php 
        echo Form::input_wrap('sort', $this->group->sort, null, __('Sort'), Arr::get($this->errors, 'sort'));
        ?>

	</fieldset>

	<fieldset>
		<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
		<?php 
        echo HTML::anchor(Request::back(Route::url('forum'), true), __('Cancel'), array('class' => 'cancel'));
        ?>

		<?php 
        echo Form::csrf();
        ?>
	</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 7
0
echo Form::open();
?>
<fieldset class="horizontal">
	<ul>
		<?php 
if (isset($private) && $private) {
    ?>
		<?php 
    echo Form::checkbox_wrap('private', '1', $values, array('onchange' => "\$('input[name=comment]').toggleClass('private', this.checked)\""), '<abbr class="private" title="' . __('Private comment') . '">' . __('Priv') . '</abbr>');
    ?>
		<?php 
}
?>

		<?php 
echo Form::input_wrap('comment', $values, array('maxlength' => 300), null, $errors);
?>

		<li><?php 
echo Form::submit(false, __('Comment'));
?>
</li>
	</ul>
	<?php 
echo Form::csrf();
?>
</fieldset>
<?php 
echo Form::close();
$new_comments = isset($new_comments) ? (int) $new_comments : 0;
foreach ($comments as $comment) {
Ejemplo n.º 8
0
	<?php 
echo implode("\n", array_reverse($ordered));
?>
</ul>

<?php 
if ($can_shout) {
    ?>

<?php 
    echo Form::open(Route::get('shouts')->uri(array('action' => 'shout')));
    ?>
<fieldset class="horizontal">
	<ul>
		<?php 
    echo Form::input_wrap('shout', '', array('maxlength' => 300, 'title' => __('Shout')), '', $errors);
    ?>
		<li><?php 
    echo Form::submit(false, __('Shout'));
    ?>
</li>
	</ul>
	<?php 
    echo Form::csrf();
    ?>
</fieldset>
<?php 
    echo Form::close();
    ?>

<?php 
Ejemplo n.º 9
0
Archivo: edit.php Proyecto: anqh/anqh
    /**
     * Date select form.
     *
     * @return  string
     */
    public function date()
    {
        ob_start();
        // Date picker options
        $options = array('changeMonth' => true, 'changeYear' => true, 'dateFormat' => 'd.m.yy', 'dayNames' => array(__('Sunday'), __('Monday'), __('Tuesday'), __('Wednesday'), __('Thursday'), __('Friday'), __('Saturday')), 'dayNamesMin' => array(__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')), 'firstDay' => 1, 'monthNames' => array(__('January'), __('February'), __('March'), __('April'), __('May'), __('June'), __('July'), __('August'), __('September'), __('October'), __('November'), __('December')), 'monthNamesShort' => array(__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jun'), __('Jul'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')), 'nextText' => __('&raquo;'), 'prevText' => __('&laquo;'), 'showWeek' => true, 'showOtherMonths' => true, 'weekHeader' => __('Wk'));
        // Form
        echo Form::open(null, array('id' => 'form-flyer-edit', 'class' => 'form-inline'));
        echo Form::input_wrap('name', $this->flyer->name, array('id' => 'field-unknown-event', 'class' => 'input-xxlarge', 'title' => __('Clean event name'), 'placeholder' => __('Clean event name')), __('Event')) . ' ';
        echo Form::input_wrap('stamp_begin[date]', is_numeric($this->flyer->stamp_begin) ? Date::format('DMYYYY', $this->flyer->stamp_begin) : $this->flyer->stamp_begin, array('id' => 'field-date', 'class' => 'input-small date', 'maxlength' => 10), __('Date')) . ' ';
        echo Form::select_wrap('stamp_begin[time]', array_reverse(Date::hours_minutes(30, true), true), is_numeric($this->flyer->stamp_begin) ? Date::format('HHMM', $this->flyer->stamp_begin) : (empty($this->flyer->stamp_begin) ? '22:00' : $this->flyer->stamp_begin), array('id' => 'field-time', 'class' => 'input-small time'), __('At')) . ' ';
        echo Form::submit('save', __('Save'), array('class' => 'btn btn-default'));
        echo Form::csrf();
        echo Form::close();
        ?>

<script>
head.ready('jquery-ui', function() {
	$('#field-date').datepicker(<?php 
        echo json_encode($options);
        ?>
);
});
</script>

<?php 
        return ob_get_clean();
    }
Ejemplo n.º 10
0
defined('SYSPATH') or die('No direct access allowed.');
/**
 * Edit gallery
 *
 * @package    Galleries
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
echo Form::open(null, array('onsubmit' => 'return false'));
?>

	<fieldset>
		<ul>
			<?php 
echo Form::input_wrap('name', $event, null, __('Event name'), $errors, __('Enter at least 3 characters'));
?>
		</ul>
	</fieldset>

<?php 
echo Form::close();
// Name autocomplete
echo HTML::script_source('
head.ready("anqh", function() {
	$("#field-name").autocompleteEvent({
		"action": function(event, ui) {
			window.location = "' . URL::site(Route::get('galleries')->uri(array('action' => 'upload'))) . '?from=" + ui.item.id;
		},
	});
	return;
Ejemplo n.º 11
0
?>

	<fieldset>
		<legend><?php 
echo __('Almost there!');
?>
</legend>
		<ul>
			<?php 
echo Form::input_wrap('username', $user, array('placeholder' => __('JohnDoe')), __('Username'), $errors, __('Choose a unique username with at least <var>:length</var> characters. No special characters, thank you.', array(':length' => Kohana::$config->load('visitor.username.length_min'))));
?>
			<?php 
echo Form::password_wrap('password', null, null, __('Password'), $errors);
?>
			<?php 
echo Form::password_wrap('password_confirm', null, null, __('Confirm'), $errors, __('Try to use letters, numbers and special characters for a stronger password, with at least <var>8</var> characters.'));
?>
			<?php 
echo Form::input_wrap('email', $user, array('disabled' => 'disabled', 'placeholder' => __('*****@*****.**')), __('Email'), $errors, __('Please remember: sign up is available only with a valid, invited email.'));
?>
		</ul>
	</fieldset>

	<fieldset>
		<?php 
echo Form::submit_wrap('register', __('Sign up!'), null, Request::back('/', true), null, array('code' => $code));
?>
	</fieldset>

<?php 
echo Form::close();
Ejemplo n.º 12
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $facebook = $this->consumer ? $this->load_facebook() : false;
        $tabs = array('basic' => '<i class="hidden-sm fa fa-fw fa-user"></i> ' . __('Profile'), 'auth' => '<i class="hidden-sm fa fa-fw fa-key"></i> ' . __('Username & Email'), 'facebook' => '<i class="hidden-sm fa fa-fw fa-facebook"></i> ' . 'Facebook', 'forum' => '<i class="hidden-sm fa fa-fw fa-comments"></i> ' . __('Forum'));
        echo Form::open();
        ?>

<?php 
        if ($this->errors) {
            ?>
<div class="alert alert-danger">
	<strong><?php 
            echo __('Error happens!');
            ?>
</strong>
	<ul>
		<?php 
            foreach ((array) $this->errors as $error) {
                ?>
		<li><?php 
                echo $error;
                ?>
</li>
		<?php 
            }
            ?>
	</ul>
</div>
<?php 
        }
        ?>

<ul class="nav nav-pills nav-stacked col-sm-2">
	<?php 
        foreach ($tabs as $tab => $title) {
            ?>
	<li<?php 
            echo $tab == $this->tab ? ' class="active"' : '';
            ?>
>
		<a href="#settings-<?php 
            echo $tab;
            ?>
" data-toggle="tab"><?php 
            echo $title;
            ?>
</a>
	</li>
	<?php 
        }
        ?>
</ul>

<div class="tab-content col-md-10">

	<div id="settings-basic" class="tab-pane<?php 
        echo $this->tab == 'basic' ? ' active' : '';
        ?>
">
		<fieldset id="fields-basic" class="col-sm-6">

			<div class="row">
			<div class="col-sm-10">
				<?php 
        echo Form::input_wrap('avatar', $this->user->avatar_url, null, __('Avatar'), Arr::get($this->errors, 'avatar'));
        ?>
			</div>
			<div class="col-sm-2">
				<?php 
        echo HTML::avatar($this->user->avatar_url, null, null, false);
        ?>
			</div>
			</div>


			<?php 
        echo Form::input_wrap('name', $this->user->name, null, __('Name'), Arr::get($this->errors, 'name'));
        ?>

			<?php 
        echo Form::radios_wrap('name_visibility', array(Model_User::NAME_VISIBLE => __('Visible'), Model_User::NAME_HIDDEN => __('Hidden')), $this->user->setting('user.name'), null, null, null, null, true);
        ?>

			<?php 
        echo Form::input_wrap('homepage', $this->user->homepage, null, __('Homepage'), Arr::get($this->errors, 'homepage'));
        ?>

			<?php 
        echo Form::radios_wrap('gender', array('f' => '<i class="fa fa-female female"></i> ' . __('Female'), 'm' => '<i class="fa fa-male male"></i> ' . __('Male'), 'o' => __('Other')), $this->user->gender, null, __('Gender'), Arr::get($this->errors, 'gender'), null, true);
        ?>

			<?php 
        echo Form::input_wrap('dob', $this->user->dob ? Date::format('DMYYYY', $this->user->dob) : null, array('class' => 'date', 'maxlength' => 10, 'size' => 7, 'placeholder' => 'd.m.yyyy'), __('Date of Birth'), Arr::get($this->errors, 'dob'));
        ?>

			<?php 
        echo Form::radios_wrap('dob_visibility', array(Model_User::DOB_VISIBLE => __('Visible'), Model_User::DOB_DATEONLY => __('Date only in profile'), Model_User::DOB_HIDDEN => __('Hidden')), $this->user->setting('user.dob'), null, null, null, null, true);
        ?>

		</fieldset>

		<fieldset id="fields-location" class="col-md-6">

			<?php 
        echo Form::input_wrap('location', $this->user->location, null, __('Where you at?'), Arr::get($this->errors, 'location'), __('e.g. <em>"Helsinki"</em> or <em>"Asema-aukio, Helsinki"</em>'));
        ?>

			<?php 
        echo Form::input_wrap('city_name', $this->user->city_name, null, __('City'), Arr::get($this->errors, 'city_name'));
        ?>

			<div id="map"></div>
		</fieldset>
	</div>


	<div id="settings-auth" class="tab-pane<?php 
        echo $this->tab == 'auth' ? ' active' : '';
        ?>
">
		<fieldset id="fields-basic" class="col-md-6">

			<?php 
        echo Form::input_wrap('username', $this->user->username, array('required', 'placeholder' => __('Required')), __('Username'), Arr::get($this->errors, 'username'));
        ?>

			<?php 
        echo Form::input_wrap('email', $this->user->email, array('required', 'placeholder' => __('Required')), __('Email'), Arr::get($this->errors, 'email'));
        ?>

			<?php 
        echo Form::password_wrap('password', null, array('placeholder' => __('Optional')), __('New password'), Arr::get($this->errors, 'password'), __('Size <em>does</em> matter - the longer, the better.'));
        ?>

			<?php 
        echo Form::password_wrap('current_password', null, array('placeholder' => __('Required')), __('Current password'), Arr::get($this->errors, 'current_password'), __('For your protection we require your current password.'));
        ?>

		</fieldset>
	</div>


	<div id="settings-facebook" class="tab-pane<?php 
        echo $this->tab == 'facebook' ? ' active' : '';
        ?>
">
		<fieldset id="fields-connections" class="col-md-6">

		<?php 
        if (!$this->external || !$this->external->loaded()) {
            ?>

			<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), '<i class="fa fa-facebook"></i> ' . __('Connect to Facebook'), array('class' => 'btn btn-primary btn-lg', 'title' => __('Connect with your Facebook account')));
            ?>

		<?php 
        } elseif (is_array($facebook)) {
            $avatar = 'https://graph.facebook.com/' . $facebook['id'] . '/picture';
            ?>

			<div class="media">
				<?php 
            echo HTML::avatar($avatar, null, 'pull-left facebook', false);
            ?>
				<div class="media-body">
					<?php 
            echo HTML::anchor($facebook['link'], HTML::chars($facebook['name']), array('target' => '_blank'));
            ?>
					<?php 
            echo Form::checkbox_wrap('avatar', $avatar, $this->user->avatar_url == $avatar, null, __('Set as your avatar'));
            ?>
					<?php 
            echo Form::checkbox_wrap('picture', $avatar . '?type=large', $this->user->picture == $avatar . '?type=large', null, __('Set as your profile image'));
            ?>
					<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'disconnect', 'provider' => 'facebook')), '<i class="icon-facebook"></i> ' . __('Disconnect your Facebook account'), array('class' => 'btn btn-danger facebook-delete', 'title' => __('Disconnect your Facebook account')));
            ?>
				</div>
			</div>

		<?php 
        } elseif ($facebook) {
            ?>

			<?php 
            echo $facebook;
            ?>

			<?php 
            echo HTML::anchor(Route::url('oauth', array('action' => 'disconnect', 'provider' => 'facebook')), '<i class="icon-facebook"></i> ' . __('Disconnect your Facebook account'), array('class' => 'btn btn-danger facebook-delete', 'title' => __('Disconnect your Facebook account')));
            ?>

		<?php 
        }
        ?>

		</fieldset>
	</div>


	<div id="settings-forum" class="tab-pane<?php 
        echo $this->tab == 'forum' ? ' active' : '';
        ?>
">
		<fieldset id="fields-forum" class="col-md-6">

			<?php 
        echo Form::input_wrap('title', $this->user->title, null, __('Title'), Arr::get($this->errors, 'title'));
        ?>

			<?php 
        echo Form::textarea_wrap('signature', $this->user->signature, array('class' => 'monospace', 'rows' => 5), true, __('Signature'), Arr::get($this->errors, 'signature'));
        ?>

		</fieldset>
	</div>

</div>

<div class="row">
	<fieldset class="col-xs-12 text-center">
		<br>
		<?php 
        echo Form::hidden('latitude', $this->user->latitude);
        ?>
		<?php 
        echo Form::hidden('longitude', $this->user->longitude);
        ?>

		<?php 
        echo Form::csrf();
        ?>
		<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-lg'));
        ?>
		<?php 
        echo HTML::anchor(URL::user($this->user), __('Cancel'), array('class' => 'cancel'));
        ?>
	</fieldset>
</div>


<?php 
        echo Form::close();
        echo $this->javascript();
        return ob_get_clean();
    }
Ejemplo n.º 13
0
Archivo: full.php Proyecto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<div class="image">
	<figure>

		<?php 
        if ($this->url) {
            echo HTML::anchor($this->url, HTML::image($this->image->get_url(null, $this->gallery->dir)), array('title' => __('Next image'), 'class' => 'image'));
        } else {
            echo HTML::anchor(Route::model($this->gallery), HTML::image($this->image->get_url(null, $this->gallery->dir)), array('title' => __('Back to gallery'), 'class' => 'image'));
        }
        ?>

		<?php 
        if ($exif = $this->exif()) {
            ?>

			<div class="exif">
				<i class="fa fa-camera-retro toggle"></i>
				<dl class="dl-horizontal">
					<?php 
            foreach ($exif as $term => $definition) {
                if (!is_null($definition)) {
                    ?>
					<dt><?php 
                    echo $term;
                    ?>
</dt><dd><?php 
                    echo $definition;
                    ?>
</dd>
					<?php 
                }
            }
            ?>
				</dl>
			</div>

		<?php 
        }
        ?>

		<?php 
        if ($this->can_note) {
            ?>

			<?php 
            echo Form::open(Route::url('gallery_image', array('gallery_id' => Route::model_id($this->gallery), 'id' => $this->image->id, 'action' => 'note')), array('id' => 'form-note', 'class' => 'panel panel-default'));
            ?>

			<fieldset class="panel-body">
				<?php 
            echo Form::input_wrap('name');
            ?>

				<?php 
            echo Form::submit('save', __('Save'), array('class' => 'btn btn-success'));
            ?>
				<a class="cancel" href="#cancel"><?php 
            echo __('Cancel');
            ?>
</a>

				<?php 
            echo Form::hidden('x');
            ?>
				<?php 
            echo Form::hidden('y');
            ?>
				<?php 
            echo Form::hidden('width');
            ?>
				<?php 
            echo Form::hidden('height');
            ?>
				<?php 
            echo Form::hidden('user_id');
            ?>
			</fieldset>

			<?php 
            echo Form::close();
            ?>

		<?php 
        }
        ?>

	</figure>

	<?php 
        echo $this->notes();
        ?>

</div>
<?php 
        return ob_get_clean();
    }
Ejemplo n.º 14
0
Archivo: edit.php Proyecto: anqh/anqh
    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open(null, array('id' => 'form-music', 'class' => 'row'));
        ?>

			<div class="col-md-8">
				<fieldset>
					<?php 
        echo Form::input_wrap('name', $this->track->name, array('class' => 'input-lg'), __('Name'), Arr::get($this->errors, 'name'));
        ?>

					<?php 
        echo Form::input_wrap('url', $this->track->url, array('placeholder' => 'http://'), __('URL'), Arr::get($this->errors, 'url'));
        ?>

					<?php 
        echo Form::textarea_wrap('description', $this->track->description, null, true, __('Description'), Arr::get($this->errors, 'description'));
        ?>

					<?php 
        if ($this->track->type == Model_Music_Track::TYPE_MIX) {
            echo Form::textarea_wrap('tracklist', $this->track->tracklist, null, true, __('Tracklist'), Arr::get($this->errors, 'tracklist'));
        }
        ?>
				</fieldset>

				<fieldset class="form-actions">
					<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
					<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>

					<?php 
        echo Form::csrf();
        ?>
				</fieldset>
			</div>

			<div class="col-md-4">
				<fieldset>
					<?php 
        echo Form::input_wrap('cover', $this->track->cover, array('placeholder' => 'http://'), __('Cover'), Arr::get($this->errors, 'cover'));
        ?>

					<?php 
        echo Form::input_wrap('size_time', $this->track->size_time, array('maxlength' => $this->track->type == Model_Music_Track::TYPE_MIX ? 8 : 6, 'placeholder' => $this->track->type == Model_Music_Track::TYPE_MIX ? __('hh:mm:ss') : __('mm:ss')), __('Length'), Arr::get($this->event_errors, 'size_time'), null, 'min');
        ?>
				</fieldset>

				<fieldset id="fields-music">
					<?php 
        echo Form::checkboxes_wrap('tag', $this->tags(), $this->track->tags(), array('class' => 'block-grid three-up'), __('Music'), $this->errors);
        ?>
				</fieldset>
			</div>

<?php 
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 15
0
Archivo: invite.php Proyecto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo $this->message;
        ?>

<div class="row">
	<div class="col-sm-6">

		<?php 
        echo Form::open();
        ?>

		<fieldset>
			<legend><?php 
        echo __('Not yet invited?');
        ?>
</legend>

			<?php 
        echo Form::input_wrap('email', $this->invitation->email, array('class' => 'input-lg', 'type' => 'email', 'placeholder' => '*****@*****.**', 'required'), __('Send an invitation to'), Arr::get($this->errors, 'email'), __('Please remember: Valid, invited email is required to join. You can invite yourself too!'));
        ?>

		</fieldset>

		<fieldset>
			<?php 
        echo Form::button('invite', '<i class="fa fa-envelope"></i> ' . __('Send invitation'), array('type' => 'submit', 'class' => 'btn btn-primary btn-large'));
        ?>
			<?php 
        echo HTML::anchor(Request::back('/', true), __('Cancel'), array('class' => 'cancel'));
        ?>
		</fieldset>

		<?php 
        echo Form::close();
        ?>

		<br>

		<?php 
        echo Form::open();
        ?>

		<fieldset>
			<legend><?php 
        echo __('Got my invitation!');
        ?>
</legend>

			<?php 
        echo Form::input_wrap('code', null, array('class' => 'input-lg', 'placeholder' => __('M0573XC3LL3N751R'), 'maxlength' => 16, 'required'), __('Invitation code'), Arr::get($this->errors, 'code'), __('Your invitation code is included in the mail you received, 16 characters.'));
        ?>

		</fieldset>

		<fieldset>
			<?php 
        echo Form::hidden('signup', true);
        ?>
			<?php 
        echo Form::button('invited', __('Final step!') . ' <i class="fa fa-arrow-right"></i>', array('type' => 'submit', 'class' => 'btn btn-primary btn-large'));
        ?>
			<?php 
        echo HTML::anchor(Request::back('/', true), __('Cancel'), array('class' => 'cancel'));
        ?>
		</fieldset>

		<?php 
        echo Form::close();
        ?>

	</div>


	<div class="col-md-1 hidden-xs text-center lead">

		<?php 
        echo __('or');
        ?>

	</div>


	<div class="col-sm-5">

		<?php 
        echo HTML::anchor(Route::url('oauth', array('action' => 'login', 'provider' => 'facebook')), '&nbsp;<i class="fa fa-facebook"></i> ' . __('Connect with Facebook') . '&nbsp;', array('class' => 'btn btn-lg btn-facebook', 'title' => __('Sign in with your Facebook account')));
        ?>

	</div>
</div>

<?php 
        return ob_get_clean();
    }
Ejemplo n.º 16
0
</legend>
		<ul>
			<?php 
echo Form::input_wrap('email', $user, null, __('Email'), $errors);
?>
			<?php 
echo Form::input_wrap('homepage', $user, null, __('Homepage'), $errors);
?>
			<?php 
echo Form::input_wrap('address_street', $user, null, __('Street address'), $errors);
?>
			<?php 
echo Form::input_wrap('address_zip', $user, null, __('Zip code'), $errors);
?>
			<?php 
echo Form::input_wrap('address_city', $user, null, __('City'), $errors);
?>
		</ul>
	</fieldset>

	<fieldset id="fields-forum">
		<legend><?php 
echo __('Forum settings');
?>
</legend>
		<ul>
			<?php 
echo Form::textarea_wrap('signature', $user, array('rows' => 5), true, __('Signature'), $errors);
?>
		</ul>
	</fieldset>
Ejemplo n.º 17
0
Archivo: edit.php Proyecto: anqh/anqh
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open(null, array('id' => 'form-venue', 'class' => 'row'));
        ?>

	<div class="col-md-8">
		<fieldset>
			<?php 
        echo Form::input_wrap('name', $this->venue->name, array('class' => 'input-lg'), __('Venue'), Arr::get($this->errors, 'name'));
        ?>

			<?php 
        echo Form::input_wrap('homepage', $this->venue->url, null, __('Homepage'), Arr::get($this->errors, 'homepage'));
        ?>

			<?php 
        echo Form::input_wrap('description', $this->venue->description, null, __('Short description'), Arr::get($this->errors, 'description'));
        ?>

			<?php 
        echo Form::textarea_wrap('hours', $this->venue->hours, null, true, __('Opening hours'), Arr::get($this->errors, 'hours'));
        ?>

			<?php 
        echo Form::textarea_wrap('info', $this->venue->info, null, true, __('Other information'), Arr::get($this->errors, 'info'));
        ?>
		</fieldset>

		<fieldset>
			<?php 
        echo Form::hidden('latitude', $this->venue->latitude, array('data-geo' => 'lat'));
        ?>
			<?php 
        echo Form::hidden('longitude', $this->venue->longitude, array('data-geo' => 'lng'));
        ?>
			<?php 
        echo Form::hidden('foursquare_id', $this->venue->foursquare_id);
        ?>
			<!--<?php 
        echo Form::hidden('foursquare_category_id', $this->venue->foursquare_category_id);
        ?>
-->

			<?php 
        echo Form::csrf();
        ?>
			<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
			<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>
		</fieldset>
	</div>

	<div class="col-md-4">
		<fieldset id="fields-location">
			<?php 
        echo Form::input_wrap('city_name', $this->venue->city_name, array('data-geo' => 'locality'), __('City'), Arr::get($this->errors, 'city_name'));
        ?>

			<?php 
        echo Form::input_wrap('foursquare', $this->venue->foursquare_id ? $this->venue->name : null, null, '<i class="fa fa-foursquare"></i> ' . __('Foursquare Venue') . ' ' . ($this->venue->foursquare_id ? '<span class="text-success" title="' . $this->venue->foursquare_id . '">(' . __('Set') . ')</span>' : '<span class="text-warning">(' . __('Not set') . ')</span>'));
        ?>

			<?php 
        echo Form::input_wrap('address', $this->venue->address, null, __('Address'), Arr::get($this->errors, 'address'));
        ?>
		</fieldset>
	</div>

	<?php 
        echo Form::close();
        ?>

<script>
head.ready('anqh', function() {

	$('#fields-location').append('<div id="map"><?php 
        echo __('Loading map..');
        ?>
</div>');

	var $city = $('input[name=city_name]');
	$city.geocomplete({
		map:              '#map',
		details:          '#form-venue',
		detailsAttribute: 'data-geo',
		location:         <?php 
        echo $this->venue->latitude ? '[ ' . $this->venue->latitude . ', ' . $this->venue->longitude . ' ]' : "'" . ($this->venue->city_name ? $this->venue->city_name : 'Helsinki') . "'";
        ?>
,
		types:            [ '(cities)' ]
	});

	var
		$latitude  = $('input[name=latitude]'),
		$longitude = $('input[name=longitude]'),
		$address   = $('input[name=address]')

	$('input[name=foursquare]')
		.on('typeahead:selected', function(event, selection, name) {
			var map    = $city.geocomplete('map')
			  , marker = $city.geocomplete('marker');

			// Update form
			if (selection.foursquare_id) {
				$('input[name=foursquare_id]').val(selection.foursquare_id);
			} else {
				$('input[name=foursquare_id]').val('');
			}
			if (selection.latitude && selection.longitude) {
				$latitude.val(selection.latitude);
				$longitude.val(selection.longitude);
				var center = new google.maps.LatLng(selection.latitude, selection.longitude);
				map.setCenter(center);
				marker.setPosition(center);
				$address.val(selection.address);
			} else {
				$city.geocomplete('find', selection.city);
			}
			$('input[name=city_name], input[name=city]').val(selection.city);

			// Update label
//			$('#fields-venue .venue-name').text(selection.value);
//			$('#fields-venue .venue-city').text(selection.city || '');
//			toggleVenue(true);
		})
		.typeahead([
			{
				name:   'foursquare',
				remote: {
					url:      Anqh.APIURL + '/v1/venues/foursquare',
					dataType: 'jsonp',
					replace:  function(url, uriEncodedQuery) {
						return url += '?method=venues&ll=' + $latitude.val() + ',' + $longitude.val() + '&query=' + uriEncodedQuery;
					},
					filter: function(parsedResponse) {
						return parsedResponse.venues || [];
					}
				}
			}
		]);

/*
	$('input[name=address], input[name=city_name]').on('blur', function geoCode(event) {
		var address = $("input[name=address]").val()
		 ,  city    = $("input[name=city_name]").val();

		if (city != '') {
			var geocode = city;
			if (address != '') {
				geocode = address + ", " + geocode;
			}

			Anqh.geocoder.geocode({ address: geocode }, function geoCoded(results, status) {
				if (status == google.maps.GeocoderStatus.OK && results.length) {
					Anqh.map.setCenter(results[0].geometry.location);
					$('input[name=latitude]').val(results[0].geometry.location.lat());
					$('input[name=longitude]').val(results[0].geometry.location.lng());
					var marker = new google.maps.Marker({
						position: results[0].geometry.location,
						map:      Anqh.map
					});
				}
			});
		}
	});
*/
});
</script>

<?php 
        return ob_get_clean();
    }
Ejemplo n.º 18
0
/**
 * Topic edit
 *
 * @package    Forum
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
$tabindex = 0;
echo Form::open(null, array('id' => 'form-topic-edit'));
?>

	<fieldset id="fields-topic">
		<ul>
			<?php 
echo Form::input_wrap('name', $topic, array('tabindex' => ++$tabindex), __('Topic'), $errors);
?>
			<?php 
if (!$post && $admin) {
    echo Form::select_wrap('status', array(Model_Forum_Topic::STATUS_NORMAL => __('Normal'), Model_Forum_Topic::STATUS_SINK => __('Sink'), Model_Forum_Topic::STATUS_LOCKED => __('Locked')), $topic, array('tabindex' => ++$tabindex), __('Status'), $errors);
    echo Form::radios_wrap('sticky', array(0 => __('Normal'), 1 => __('Sticky')), $topic->sticky, null, __('Sticky'), $errors);
}
?>
			<?php 
if ($private) {
    echo Form::textarea_wrap('recipients', $recipients, array('rows' => 3, 'placeholder' => __('Required'), 'tabindex' => ++$tabindex), null, __('Recipients'), $errors);
}
?>
		</ul>
	</fieldset>
Ejemplo n.º 19
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Create form attributes
        $attributes = array('class' => 'media');
        if ($this->form_id) {
            $attributes['id'] = $this->form_id;
        }
        $button = __('Save');
        $author = Visitor::$user;
        if (!$this->form_action) {
            switch ($this->mode) {
                case self::QUOTE:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->parent_id, 'action' => 'quote'));
                    $button = __('Reply');
                    break;
                case self::REPLY:
                    $this->form_action = Route::model($this->forum_topic, 'reply');
                    $button = __('Reply');
                    break;
                case self::EDIT_POST:
                    $this->form_action = Route::url($this->private ? 'forum_private_post' : 'forum_post', array('topic_id' => $this->forum_topic->id, 'id' => $this->forum_post->id, 'action' => 'edit'));
                    $author = $this->forum_post->author();
                    break;
            }
        }
        echo Form::open($this->form_action ? $this->form_action : null, $attributes);
        // Progressively add content, note that we don't break
        switch ($this->mode) {
            // Adding new topic
            case self::NEW_TOPIC:
                // Editing an old topic
            // Editing an old topic
            case self::EDIT_TOPIC:
                $is_admin = Visitor::$user->has_role(array('admin', 'moderator', 'forum moderator'));
                if ($is_admin) {
                    // Build available areas list
                    $areas = array();
                    foreach (Model_Forum_Group::factory()->find_all() as $_group) {
                        $areas[$_group->name] = array();
                        foreach ($_group->areas() as $_area) {
                            $areas[$_group->name][$_area->id] = $_area->name;
                        }
                    }
                    ?>

<div class="panel panel-danger">
	<header class="panel-heading"><?php 
                    echo __('Admin tools');
                    ?>
</header>
	<fieldset class="form-horizontal panel-body">
		<div class="col-md-6">
			<?php 
                    echo Form::radios_wrap('sticky', array(Model_Forum_Topic::STICKY_NORMAL => __('Normal'), Model_Forum_Topic::STICKY_STICKY => '<i class="fa fa-thumb-tack text-warning"></i> ' . __('Pinned')), (int) $this->forum_topic->sticky, array('class' => 'radios'), __('Pinning'), Arr::get($this->errors, 'sticky'), null, true);
                    ?>
		</div>

		<div class="col-md-6">
			<?php 
                    echo Form::radios_wrap('status', array(Model_Forum_Topic::STATUS_NORMAL => __('Normal'), Model_Forum_Topic::STATUS_SINK => '<i class="fa fa-unlock text-muted"></i> ' . __('Sink'), Model_Forum_Topic::STATUS_LOCKED => '<i class="fa fa-lock text-muted"></i> ' . __('Locked')), (int) $this->forum_topic->status, array('class' => 'radios'), __('Status'), Arr::get($this->errors, 'status'), null, true);
                    ?>
		</div>

		<div class="col-md-12">
			<?php 
                    if (!$this->private) {
                        echo Form::select_wrap('forum_area_id', $areas, $this->forum_topic->forum_area_id, null, __('Area'), Arr::get($this->errors, 'forum_area_id'));
                    }
                    ?>
		</div>

	</fieldset>
</div>

		<?php 
                }
                // admin
                ?>

	<?php 
                echo Form::input_wrap('name', $this->forum_topic->name, null, __('Topic'), Arr::get($this->errors, 'name'));
                ?>

	<?php 
                if ($this->private) {
                    echo Form::textarea_wrap('recipients', $this->recipients, array('rows' => 3, 'placeholder' => __('Required')), true, __('Recipients'), Arr::get($this->errors, 'recipients'));
                }
                ?>

	<?php 
                if ($this->mode === self::EDIT_TOPIC && !$is_admin) {
                    ?>

<fieldset>
	<?php 
                    echo Form::button('save', $button, array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
                    ?>
	<?php 
                    echo Form::button('preview', __('Preview'), array('class' => 'btn btn-default btn-large'));
                    ?>
	<?php 
                    echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
                    ?>

	<?php 
                    echo Form::csrf();
                    ?>
</fieldset>

<?php 
                    break;
                }
                // Replying to a topic
            // Replying to a topic
            case self::REPLY:
            case self::QUOTE:
                ?>

<div class="pull-left">
	<?php 
                echo HTML::avatar(Visitor::$user->avatar_url, Visitor::$user->username);
                ?>
</div>

<?php 
                // Editing old post
            // Editing old post
            case self::EDIT_POST:
                ?>

<div class="post-edit media-body panel panel-success form-vertical">
	<header class="panel-heading">
		<?php 
                echo $author ? HTML::user($author) : HTML::chars($this->forum_post->author_name);
                ?>
	</header>

	<fieldset class="panel-body">
		<?php 
                echo Form::textarea_wrap('post', $this->forum_post->post, array('id' => uniqid()), true, null, Arr::get($this->errors, 'post'), null, true);
                ?>
	</fieldset>

	<fieldset class="panel-body">
		<?php 
                echo Form::button('save', $button, array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
                ?>
		<?php 
                echo Form::button('preview', __('Preview'), array('class' => 'btn btn-default btn-large'));
                ?>
		<?php 
                echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
                ?>

		<?php 
                echo Form::csrf();
                ?>
	</fieldset>
</div>

<?php 
        }
        ?>


<?php 
        echo Form::close();
        // Auto-complete recipients
        if ($this->private) {
            ?>

<script>
head.ready('anqh', function() {
	$('textarea[name=recipients]').autocompleteUser({
		user:     <?php 
            echo Visitor::$user->id;
            ?>
,
		maxUsers: 100
	});
});
</script>

<?php 
        }
        return ob_get_clean();
    }
Ejemplo n.º 20
0
echo Form::open();
?>

	<fieldset>
		<ul>
			<?php 
echo Form::select_wrap('forum_group_id', $groups, $area, null, __('Group'), $errors);
?>
			<?php 
echo Form::input_wrap('name', $area, null, __('Name'), $errors);
?>
			<?php 
echo Form::input_wrap('description', $area, null, __('Description'), $errors);
?>
			<?php 
echo Form::input_wrap('sort', $area, null, __('Sort'), $errors);
?>
		</ul>
	</fieldset>

	<fieldset>
		<legend><?php 
echo __('Settings');
?>
</legend>
		<ul>
			<?php 
echo Form::select_wrap('access_read', array(Model_Forum_Area::READ_NORMAL => __('Everybody'), Model_Forum_Area::READ_MEMBERS => __('Members only')), $area, null, __('Read access'));
?>
			<?php 
echo Form::select_wrap('access_write', array(Model_Forum_Area::WRITE_NORMAL => __('Members'), Model_Forum_Area::WRITE_ADMINS => __('Admins only')), $area, null, __('Write access'));
Ejemplo n.º 21
0
<?php

if (!isset($show_date) || $show_date) {
    echo Form::input_wrap($name . '[date]', is_numeric($value) ? Date::format('DMYYYY', $value) : $value, $attributes + array('class' => 'date', 'maxlength' => 10) + Form::attributes($field), isset($label_date) ? $label_date : '', isset($errors) ? Arr::get($errors, $name) : '', isset($tip_date) ? $tip_date : '');
}
if (!isset($show_time) || $show_time) {
    /*echo Form::input_wrap(
    		$name . '[time]',
    		is_numeric($value) ? Date::format('HHMM', $value) : $value,
    		$attributes + array('class' => 'time', 'maxlength' => 5) + Form::attributes($field),
    		isset($label_time) ? $label_time : '',
    		isset($errors) ? Arr::get($errors, $name) : '',
    		isset($tip_time) ? $tip_time : ''
    	);*/
    echo Form::select_wrap($name . '[time]', Date::hours_minutes(30, true), is_numeric($value) ? Date::format('HHMM', $value) : (empty($value) && isset($default_time) ? $default_time : $value), $attributes + array('class' => 'time') + Form::attributes($field), isset($label_time) ? $label_time : '', isset($errors) ? Arr::get($errors, $name) : '', isset($tip_time) ? $tip_time : '');
}
Ejemplo n.º 22
0
<?php

echo Form::input_wrap($name, $value, $attributes + Form::attributes($field), isset($label) ? $label : '', isset($errors) ? $errors : '', isset($tip) ? $tip : '');
Ejemplo n.º 23
0
        ?>
</a></li>
			<?php 
    }
    ?>

		</ul>
	</figcaption>

	<?php 
    echo Form::open(Route::get('gallery_image')->uri(array('gallery_id' => Route::model_id($gallery), 'id' => $image->id, 'action' => 'note')), array('id' => 'form-note'));
    ?>
		<fieldset>
			<ul>
				<?php 
    echo Form::input_wrap('name');
    ?>
			</ul>
			<?php 
    echo Form::submit_wrap('save', __('Save'), null, '#cancel', null, array('x' => null, 'y' => null, 'width' => null, 'height' => null, 'user_id' => null));
    ?>
		</fieldset>
	<?php 
    echo Form::close();
    ?>

<?php 
}
// Notes
?>
Ejemplo n.º 24
0
<?php

echo Form::input_wrap($name, is_numeric($value) ? date($pretty_format, $value) : $value, $attributes + Form::attributes($field), isset($label) ? $label : '', isset($errors) ? $errors : '', isset($tip) ? $tip : '');
Ejemplo n.º 25
0
 *
 * @package    Forum
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
echo Form::open();
?>

	<fieldset>
		<ul>
			<?php 
echo Form::input_wrap('name', $group, null, __('Name'), $errors);
?>
			<?php 
echo Form::input_wrap('description', $group, null, __('Description'), $errors);
?>
			<?php 
echo Form::input_wrap('sort', $group, null, __('Sort'), $errors);
?>
		</ul>
	</fieldset>

	<fieldset>
		<?php 
echo Form::submit_wrap('save', __('Save'), null, Request::back(Route::get('forum_group')->uri(), true));
?>
	</fieldset>

<?php 
echo Form::close();
Ejemplo n.º 26
0
<div class="grid8 first">
	<fieldset id="fields-info">
		<ul>
			<?php 
echo Form::input_wrap('name', $flyer, null, __('Event'), $errors);
?>
		</ul>
	</fieldset>
</div>

<div class="grid3">
	<fieldset id="fields-date">
		<ul>
			<?php 
echo Form::input_wrap('stamp_begin[date]', is_numeric($flyer->stamp_begin) ? Date::format('DMYYYY', $flyer->stamp_begin) : $flyer->stamp_begin, array('class' => 'date', 'maxlength' => 10), __('Date'), Arr::get($errors, 'stamp_begin'));
?>
			<?php 
echo Form::select_wrap('stamp_begin[time]', Date::hours_minutes(30, true), is_numeric($flyer->stamp_begin) ? Date::format('HHMM', $flyer->stamp_begin) : (empty($flyer->stamp_begin) ? '22:00' : $flyer->stamp_begin), array('class' => 'time'), __('At'), Arr::get($errors, 'stamp_begin'));
?>
		</ul>
	</fieldset>
</div>

<div class="grid1">
	<fieldset class="grid1">
		<?php 
echo Form::csrf();
?>
		<?php 
echo Form::submit_wrap('save', __('Save'));
Ejemplo n.º 27
0
defined('SYSPATH') or die('No direct access allowed.');
/**
 * Tag group edit
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2011 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
echo Form::open();
?>

	<fieldset>
		<ul>
			<?php 
echo Form::input_wrap('name', $group, array('maxlength' => 32), __('Name'), $errors);
?>
			<?php 
echo Form::input_wrap('description', $group, null, __('Description'), $errors);
?>
		</ul>
	</fieldset>

	<fieldset>
		<?php 
echo Form::submit_wrap('save', __('Save'), null, Request::back(Route::get('tags')->uri(), true));
?>
	</fieldset>

<?php 
echo Form::close();
Ejemplo n.º 28
0
Archivo: edit.php Proyecto: anqh/anqh
    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<div id="preview"></div>

<?php 
        echo Form::open(null, array('id' => 'form-event', 'class' => 'row'));
        ?>

<div class="col-md-8">

	<?php 
        if ($this->event_errors || $this->venue_errors) {
            ?>
	<div class="alert alert-danger">
		<strong><?php 
            echo __('Error happens!');
            ?>
</strong>
		<ul class="">
			<?php 
            foreach ((array) $this->event_errors as $error) {
                ?>
			<li><?php 
                echo $error;
                ?>
</li>
			<?php 
            }
            ?>
			<?php 
            foreach ((array) $this->venue_errors as $error) {
                ?>
			<li><?php 
                echo __('Venue');
                ?>
: <?php 
                echo $error;
                ?>
</li>
			<?php 
            }
            ?>
		</ul>
	</div>
	<?php 
        }
        ?>

	<fieldset id="fields-primary">
		<?php 
        echo Form::input_wrap('name', $this->event->name, array('class' => 'input-lg'), __('Name'), Arr::get($this->event_errors, 'name'), __("Please don't use dates in the name, looks nasty everywhere as the date is usually shown automagically."));
        ?>

		<?php 
        echo Form::textarea_wrap('info', $this->event->info, array('class' => 'input-lg', 'rows' => 20), true, __('Information'), Arr::get($this->event_errors, 'info'), __('Remember, only the first few rows are visible in the calendar view.'), true);
        ?>
	</fieldset>

	<fieldset>
		<?php 
        echo Form::button('save', __('Save event'), array('type' => 'submit', 'class' => 'btn btn-success btn-lg'));
        ?>
		<?php 
        echo Form::button('preview', __('Preview'), array('class' => 'btn btn-default btn-lg', 'data-content-class' => '*', 'data-prepend' => '#preview'));
        ?>
		<?php 
        echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
        ?>

		<?php 
        echo Form::csrf();
        ?>
		<?php 
        echo Form::hidden('latitude', $this->venue->latitude, array('data-geo' => 'lat'));
        ?>
		<?php 
        echo Form::hidden('longitude', $this->venue->longitude, array('data-geo' => 'lng'));
        ?>
		<?php 
        echo Form::hidden('city', $this->event->city_name, array('data-geo' => 'locality'));
        ?>
		<?php 
        echo Form::hidden('venue_id', $this->venue->id);
        ?>
		<?php 
        echo Form::hidden('foursquare_id', $this->venue->foursquare_id);
        ?>
	</fieldset>
</div>

<div class="col-md-4">

	<fieldset id="fields-when" class="row form-inline">
		<div class="col-md-3">
			<?php 
        echo Form::input_wrap('stamp_begin[date]', is_numeric($this->event->stamp_begin) ? Date::format('DMYYYY', $this->event->stamp_begin) : $this->event->stamp_begin, array('class' => 'date', 'maxlength' => 10, 'size' => 7, 'placeholder' => 'd.m.yyyy'), __('From'), Arr::Get($this->event_errors, 'stamp_begin'));
        ?>
		</div>

		<div class="col-md-3">
			<?php 
        echo Form::select_wrap('stamp_begin[time]', array_reverse(Date::hours_minutes(30, true)), is_numeric($this->event->stamp_begin) ? Date::format('HHMM', $this->event->stamp_begin) : (empty($this->event->stamp_begin) ? '22:00' : $this->event->stamp_begin), array('class' => 'time'), '&nbsp;', Arr::get($this->event_errors, 'stamp_begin'));
        ?>
		</div>

		<div class="col-md-3">
			<?php 
        echo Form::select_wrap('stamp_end[time]', Date::hours_minutes(30, true), is_numeric($this->event->stamp_end) ? Date::format('HHMM', $this->event->stamp_end) : (empty($this->event->stamp_end) ? '04:00' : $this->event->stamp_end), array('class' => 'time'), __('To'), Arr::get($this->event_errors, 'stamp_end'));
        ?>
		</div>

		<div class="col-md-3">
			<?php 
        echo Form::input_wrap('stamp_end[date]', is_numeric($this->event->stamp_end) ? Date::format('DMYYYY', $this->event->stamp_end) : $this->event->stamp_end, array('class' => 'date', 'maxlength' => 10, 'size' => 7, 'placeholder' => 'd.m.yyyy'), '&nbsp;', Arr::Get($this->event_errors, 'stamp_end'));
        ?>
		</div>
	</fieldset>

	<br>

	<fieldset id="fields-venue" class="row">
		<div class="col-md-12">
			<?php 
        echo Form::input_wrap('city_name', $this->event->city_name, null, __('City'), Arr::get($this->event_errors, 'city_name'));
        ?>
		</div>

		<div class="col-md-7">
			<?php 
        echo Form::input_wrap('venue_name', $this->event->venue_name, (bool) $this->event->venue_hidden ? array('disabled') : null, __('Venue'), Arr::get($this->event_errors, 'venue_name'));
        ?>
		</div>

		<div class="col-md-5">
			<br>
			<?php 
        echo Form::checkbox_wrap('venue_hidden', 'true', (bool) $this->event->venue_hidden, array('id' => 'field-ug'), __('Underground'));
        ?>
		</div>

		<div class="col-md-12 venue-placeholder hidden">
			<label><?php 
        echo __('Venue');
        ?>
</label>
			<p>
				<span class="venue-name"><?php 
        echo $this->event->venue_name;
        ?>
</span>,
				<span class="venue-city"><?php 
        echo $this->event->city_name;
        ?>
</span>
				<a href="#venue"><?php 
        echo __('Change');
        ?>
</a>
			</p>
		</div>
	</fieldset>

	<div id="map" class="well"></div>

	<fieldset>
		<?php 
        if (!$this->event->flyer_id) {
            echo Form::input_wrap('flyer', $this->event->flyer_url, array('type' => 'url', 'placeholder' => 'http://'), __('Flyer'), $this->flyer_error, __('If you have the flyer only locally you can upload it after saving the event.'));
        }
        ?>

		<?php 
        echo Form::input_wrap('url', $this->event->url, array('type' => 'url', 'placeholder' => 'http://'), __('Homepage'), Arr::get($this->event_errors, 'url'));
        ?>
	</fieldset>

	<fieldset id="fields-tickets" class="row">
		<div class="col-md-4">
			<?php 
        echo Form::input_wrap('price', $this->event->price, $this->event->price === '0.00' ? array('disabled', 'type' => 'number', 'min' => 0, 'step' => 0.5) : array('type' => 'number', 'min' => 0, 'step' => 0.5), __('Tickets'), Arr::get($this->event_errors, 'tickets'), null, '&euro;');
        ?>
		</div>

		<div class="col-md-8">
			<br>
			<?php 
        echo Form::checkbox_wrap('free', 'true', $this->event->price === '0.00', array('id' => 'field-free'), __('Free entry'));
        ?>
		</div>

		<div class="col-md-12">
			<?php 
        echo Form::input_wrap('ticket_url', $this->event->ticket_url, array('placeholder' => 'http://'), __('Buy tickets from'), Arr::get($this->event_errors, 'ticket_url'));
        ?>
		</div>

		<div class="col-md-5">
			<?php 
        echo Form::input_wrap('age', $this->event->age, array('type' => 'number', 'min' => 0, 'max' => 50, 'maxlength' => 3), __('Age limit'), Arr::get($this->event_errors, 'age'), null, __('years'));
        ?>
		</div>
	</fieldset>

	<fieldset id="fields-music">
		<?php 
        echo Form::checkboxes_wrap('tag', $this->tags(), $this->event->tags(), array('class' => 'block-grid three-up'), __('Music'), $this->event_errors);
        ?>
	</fieldset>
</div>

		<?php 
        echo Form::close();
        echo $this->javascript();
        return ob_get_clean();
    }
Ejemplo n.º 29
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        echo Form::open();
        if ($this->venue_duplicate) {
            // Confirm
            $venue = new View_Venue_Info($this->venue);
            $duplicate = new View_Venue_Info($this->venue_duplicate);
            ?>

<div class="col-sm-3">

	<h3><?php 
            echo HTML::anchor(Route::model($this->venue_duplicate), HTML::chars($this->venue_duplicate->name));
            ?>
</h3>
	#<?php 
            echo $this->venue_duplicate->id;
            ?>

	<?php 
            echo $duplicate->content();
            ?>

</div>

<div class="col-sm-1">

	<h3><?php 
            echo __('to');
            ?>
</h3>

</div>

<div class="col-sm-3">

	<h3><?php 
            echo HTML::anchor(Route::model($this->venue), HTML::chars($this->venue->name));
            ?>
</h3>
	#<?php 
            echo $this->venue->id;
            ?>

	<?php 
            echo $venue->content();
            ?>

</div>

<div class="col-sm-1">

	<?php 
            echo HTML::anchor(Route::model($this->venue, 'combine') . '/' . $this->venue_duplicate->id . '?' . Security::csrf_query(), __('Merge'), array('class' => 'btn btn-primary'));
            ?>

</div>

<?php 
        } else {
            // Select duplicate
            echo Form::input_wrap('venue', null, null, __('Combine to'));
            ?>

<script>
	head.ready('anqh', function() {

		var venues = <?php 
            echo json_encode(Model_Venue::factory()->find_all_autocomplete($this->venue->id));
            ?>
;
		$('input[name=venue]').autocompleteVenue({
			source: venues,
			action: function(event, ui) {
				window.location = window.location + '/' + ui.item.id;
			}
		});

	});
</script>

<?php 
        }
        echo Form::close();
        return ob_get_clean();
    }
Ejemplo n.º 30
0
    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Build available groups list
        $groups = array();
        foreach (Model_Forum_Group::factory()->find_all() as $_group) {
            $groups[$_group->id] = $_group->name;
        }
        echo Form::open();
        ?>

	<fieldset>

		<?php 
        echo Form::select_wrap('forum_group_id', $groups, $this->area->forum_group_id, null, __('Group'), Arr::get($this->errors, 'forum_group_id'));
        ?>

		<?php 
        echo Form::input_wrap('name', $this->area->name, null, __('Name'), Arr::get($this->errors, 'name'));
        ?>

		<?php 
        echo Form::input_wrap('description', $this->area->description, null, __('Description'), Arr::get($this->errors, 'description'));
        ?>

		<?php 
        echo Form::input_wrap('sort', $this->area->sort, null, __('Sort'), Arr::get($this->errors, 'sort'));
        ?>

	</fieldset>

	<fieldset class="row">
		<legend><?php 
        echo __('Settings');
        ?>
</legend>

		<div class="col-sm-2">
			<?php 
        echo Form::select_wrap('status', array(Model_Forum_Area::STATUS_NORMAL => __('Normal'), Model_Forum_Area::STATUS_HIDDEN => __('Hidden')), $this->area->status, null, __('Status'), Arr::get($this->errors, 'status'));
        ?>
		</div>

		<div class="col-sm-2">
			<?php 
        echo Form::select_wrap('access_read', array(Model_Forum_Area::READ_NORMAL => __('Everybody'), Model_Forum_Area::READ_MEMBERS => __('Members only')), $this->area->access_read, null, __('Read access'), Arr::get($this->errors, 'access_read'));
        ?>
		</div>

		<div class="col-sm-2">
			<?php 
        echo Form::select_wrap('access_write', array(Model_Forum_Area::WRITE_NORMAL => __('Members'), Model_Forum_Area::WRITE_ADMINS => __('Admins only')), $this->area->access_write, null, __('Write access'), Arr::get($this->errors, 'access_write'));
        ?>
		</div>

		<div class="col-sm-3">
			<?php 
        echo Form::select_wrap('type', array(Model_Forum_Area::TYPE_NORMAL => __('Normal'), Model_Forum_Area::TYPE_BIND => __('Bind, topics bound to content')), $this->area->type, null, __('Type'), Arr::get($this->errors, 'type'));
        ?>
		</div>

		<div class="col-sm-3">
			<?php 
        echo Form::select_wrap('bind', array('' => __('None')) + Model_Forum_Area::get_binds(), $this->area->bind, null, __('Bind config'), Arr::get($this->errors, 'bind'));
        ?>
		</div>

	</fieldset>

	<fieldset>
		<?php 
        echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
        ?>
		<?php 
        echo HTML::anchor(Request::back(Route::url('forum'), true), __('Cancel'), array('class' => 'cancel'));
        ?>

		<?php 
        echo Form::csrf();
        ?>
	</fieldset>

<?php 
        echo Form::close();
        return ob_get_clean();
    }