Esempio n. 1
0
				<li class="<?php 
        echo text_helper::alternate('odd', 'even');
        ?>
" id="row-picture-<?php 
        echo $picture['picture_id'];
        ?>
">

					<figure class="image classifieds-image">
						<div class="image thumbnail" style="background-image:url('<?php 
        echo storage_helper::getFileURL($picture['file_service_id'], $picture['file_path'], $picture['file_name'], $picture['file_ext'], 't', $picture['file_modify_date']);
        ?>
');">
							<?php 
        echo html_helper::anchor('classifieds/pictures/view/' . $picture['picture_id'] . '/' . text_helper::slug($picture['data_description'], 100), '<span class="name">' . $picture['data_description'] . '</span>', array('class' => 'image'));
        ?>
						</div>
					</figure>

				</li>

			<?php 
    }
    ?>

		</ul>

	<?php 
}
?>
Esempio n. 2
0
 public function edit()
 {
     // Is user logged in?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     } elseif (!session::permission('albums_post', 'pictures')) {
         view::noAccess(session::item('slug'));
     }
     // Get URI vars
     $albumID = (int) uri::segment(4);
     // Did user reach the max albums limit?
     if (!$albumID && session::permission('albums_limit', 'pictures') && session::permission('albums_limit', 'pictures') <= session::item('total_albums')) {
         view::setError(__('album_limit_reached', 'pictures', array('%limit%' => session::permission('albums_limit', 'pictures'))));
         router::redirect('pictures/albums/manage');
     }
     // Get fields
     $fields = $this->fields_model->getFields('pictures', 1, 'edit', 'in_account');
     // Get album
     $album = array();
     if ($albumID && (!($album = $this->pictures_albums_model->getAlbum($albumID, $fields, array('escape' => false, 'parse' => false))) || $album['user_id'] != session::item('user_id'))) {
         view::setError(__('no_album', 'pictures'));
         router::redirect('pictures/albums/manage');
     }
     // Privacy options
     $privacy = array();
     // Do we need to add privacy field?
     if (config::item('album_privacy_view', 'pictures')) {
         $items = $this->users_model->getPrivacyOptions(session::item('privacy_profile', 'config'));
         $privacy[] = array('name' => __('privacy_album_view', 'pictures_privacy', array(), array(), false), 'keyword' => 'privacy', 'type' => 'select', 'items' => $items, 'privacy' => config::item('privacy_default', 'users'));
     }
     // Do we need to add enable comments field?
     if (config::item('picture_comments', 'pictures') && config::item('picture_privacy_comments', 'pictures')) {
         $items = $this->users_model->getPrivacyOptions(session::item('privacy_profile', 'config'), false);
         $items[0] = __('privacy_comments_disable', 'comments_privacy');
         $privacy[] = array('name' => __('privacy_comments_post', 'comments_privacy', array(), array(), false), 'keyword' => 'comments', 'type' => 'select', 'items' => $items, 'comments' => config::item('privacy_default', 'users'));
     }
     // Do we need to add search field?
     if (config::item('album_privacy_public', 'pictures')) {
         $privacy[] = array('name' => __('privacy_search', 'system', array(), array(), false), 'keyword' => 'public', 'type' => 'boolean');
     }
     // Assign vars
     view::assign(array('albumID' => $albumID, 'album' => $album, 'fields' => $fields, 'privacy' => $privacy));
     // Process form values
     if (input::post('do_save_album')) {
         $this->_saveAlbum($albumID, $album, $fields);
     }
     // Set title
     view::setTitle(__($albumID ? 'album_edit' : 'album_new', 'pictures'));
     // Set trail
     view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
     view::setTrail('pictures/manage', __('pictures_albums', 'system_navigation'));
     if ($albumID && $album['total_pictures'] + $album['total_pictures_i'] > 0) {
         view::setTrail('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), __('album_view', 'pictures'), array('side' => true));
     }
     // Assign actions
     if ($albumID) {
         view::setAction('pictures/upload/' . $albumID, __('pictures_new', 'pictures'), array('class' => 'icon-text icon-pictures-new', 'data-role' => 'modal', 'data-title' => __('pictures_new', 'pictures')));
     }
     // Load view
     view::load('pictures/albums/edit');
 }
Esempio n. 3
0
        ?>
								<?php 
        echo html_helper::anchor('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), '<span class="name">' . $album['data_title'] . '</span>', array('class' => 'image'));
        ?>
								<div class="overlay element pictures">
									<?php 
        echo __('pictures_num' . ($album['total_pictures'] == 1 ? '_one' : ''), 'system_info', array('%pictures' => $album['total_pictures']));
        ?>
								</div>
							</div>
						</figure>

						<header class="item-header">
							<h2>
								<?php 
        echo html_helper::anchor('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), $album['data_title']);
        ?>
							</h2>
						</header>

						<div class="item-article">
							<?php 
        if ($album['data_description']) {
            ?>
								<?php 
            echo $album['data_description'];
            ?>
							<?php 
        }
        ?>
						</div>
Esempio n. 4
0
        } else {
            ?>
								<div class="image thumbnail no_image">
							<?php 
        }
        ?>
								<?php 
        echo html_helper::anchor('classifieds/view/' . $ad['ad_id'] . '/' . text_helper::slug($ad['data_title'], 100), '<span class="name">' . $ad['data_title'] . '</span>', array('class' => 'image'));
        ?>
							</div>
						</figure>

						<header class="item-header">
							<h2>
								<?php 
        echo html_helper::anchor('classifieds/view/' . $ad['ad_id'] . '/' . text_helper::slug($ad['data_title'], 100), $ad['data_title']);
        ?>
							</h2>
						</header>

						<dl class="content-grid">
							<?php 
        if (isset($ad['data_price'])) {
            ?>
								<dt><?php 
            echo config::item('fields_classifieds', 'core', 'price');
            ?>
:</dt>
								<dd>
									<?php 
            echo money_helper::symbol(config::item('ad_currency', 'classifieds')) . $ad['data_price'];
Esempio n. 5
0
				<?php 
    }
    ?>

			</ul>

			<fieldset class="form">

				<div class="row actions">
					<?php 
    view::load('system/elements/button', array('value' => __('update', 'system')));
    ?>
				&nbsp;
				<?php 
    echo html_helper::anchor('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), __('cancel', 'system'));
    ?>
				</div>

			</fieldset>

		<?php 
    echo form_helper::closeForm(array('do_save_pictures' => 1));
    ?>

	<?php 
}
?>

</section>
Esempio n. 6
0
		<ul class="unstyled item-list icon-list narrow arrow <?php 
    echo text_helper::alternate();
    ?>
">

			<?php 
    foreach ($blogs as $blog) {
        ?>

				<li class="<?php 
        echo text_helper::alternate('odd', 'even');
        ?>
 nowrap nooverflow" id="row-helper-blog-<?php 
        echo $blog['blog_id'];
        ?>
">
					<?php 
        echo html_helper::anchor('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), $blog['data_title'], array('title' => $blog['data_title']));
        ?>
				</li>

			<?php 
    }
    ?>

		</ul>

	</div>

<?php 
}
Esempio n. 7
0
				<?php 
    }
    ?>

			</ul>

			<fieldset class="form">

				<div class="row actions">
					<?php 
    view::load('system/elements/button', array('value' => __('update', 'system')));
    ?>
					&nbsp;
					<?php 
    echo html_helper::anchor('classifieds/pictures/index/' . $ad['ad_id'] . '/' . text_helper::slug($ad['data_title'], 100), __('cancel', 'system'));
    ?>
				</div>

			</fieldset>

		<?php 
    echo form_helper::closeForm(array('do_save_pictures' => 1));
    ?>

	<?php 
}
?>

</section>
Esempio n. 8
0
 public function edit()
 {
     // Is user logged in?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     } elseif (!session::permission('blogs_post', 'blogs')) {
         view::noAccess(session::item('slug'));
     }
     // Get URI vars
     $blogID = (int) uri::segment(3);
     // Did user reach the max blogs limit?
     if (!$blogID && session::permission('blogs_limit', 'blogs') && session::permission('blogs_limit', 'blogs') <= session::item('total_blogs') + session::item('total_blogs_i')) {
         view::setError(__('blog_limit_reached', 'blogs', array('%limit%' => session::permission('blogs_limit', 'blogs'))));
         router::redirect('blogs/manage');
     }
     // Get blog fields
     $fields = $this->fields_model->getFields('blogs', 0, 'edit', 'in_account');
     // Get blog
     $blog = array();
     if ($blogID && (!($blog = $this->blogs_model->getBlog($blogID, $fields, array('escape' => false, 'parse' => false))) || $blog['user_id'] != session::item('user_id'))) {
         view::setError(__('no_blog', 'blogs'));
         router::redirect('blogs/manage');
     }
     // Privacy options
     $privacy = array();
     // Do we need to add privacy field?
     if (config::item('blog_privacy_view', 'blogs')) {
         $items = $this->users_model->getPrivacyOptions(session::item('privacy_profile', 'config'));
         $privacy[] = array('name' => __('privacy_blog_view', 'blogs_privacy', array(), array(), false), 'keyword' => 'privacy', 'type' => 'select', 'items' => $items, 'privacy' => config::item('privacy_default', 'users'));
     }
     // Do we need to add enable comments field?
     if (config::item('blog_comments', 'blogs') && config::item('blog_privacy_comments', 'blogs')) {
         $items = $this->users_model->getPrivacyOptions(session::item('privacy_profile', 'config'), false);
         $items[0] = __('privacy_comments_disable', 'comments_privacy');
         $privacy[] = array('name' => __('privacy_comments_post', 'comments_privacy', array(), array(), false), 'keyword' => 'comments', 'type' => 'select', 'items' => $items, 'comments' => config::item('privacy_default', 'users'));
     }
     // Do we need to add search field?
     if (config::item('blog_privacy_public', 'blogs')) {
         $privacy[] = array('name' => __('privacy_search', 'system', array(), array(), false), 'keyword' => 'public', 'type' => 'boolean');
     }
     // Assign vars
     view::assign(array('blogID' => $blogID, 'blog' => $blog, 'fields' => $fields, 'privacy' => $privacy));
     // Process form values
     if (input::post('do_save_blog')) {
         $this->_saveBlog($blogID, $blog, $fields);
     }
     // Set title
     view::setTitle(__($blogID ? 'blog_edit' : 'blog_new', 'blogs'));
     // Set trail
     view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
     view::setTrail('blogs/manage', __('blogs', 'system_navigation'));
     if ($blogID) {
         view::setTrail('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), __('blog_view', 'blogs'), array('side' => true));
     }
     // Load view
     view::load('blogs/edit');
 }
Esempio n. 9
0
        ?>

				<li class="clearfix <?php 
        echo text_helper::alternate('odd', 'even');
        ?>
" id="row-news-<?php 
        echo $entry['news_id'];
        ?>
">

					<article class="item">

						<header class="item-header">
							<h2>
								<?php 
        echo html_helper::anchor((config::item('news_blog', 'news') ? 'blog' : 'news') . '/view/' . $entry['news_id'] . '/' . text_helper::slug($entry['data_title'], 100), $entry['data_title']);
        ?>
							</h2>
						</header>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($entry['data_body'], config::item('news_preview_chars', 'news'));
        ?>
						</div>

						<footer class="item-footer">

							<ul class="unstyled content-meta clearfix">
								<li class="date">
									<?php 
Esempio n. 10
0
					<article class="item">

						<header class="item-header">
							<h3>
								<?php 
        echo html_helper::anchor('news/view/' . $entry['news_id'] . '/' . text_helper::slug($entry['data_title'], 100), $entry['data_title']);
        ?>
							</h3>
						</header>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($entry['data_body'], isset($params['truncate']) && $params['truncate'] ? $params['truncate'] : config::item('news_preview_chars', 'news'));
        ?>
							<?php 
        echo html_helper::anchor('news/view/' . $entry['news_id'] . '/' . text_helper::slug($entry['data_title'], 100), '&raquo;');
        ?>
						</div>

					</article>

				</li>

			<?php 
    }
    ?>

		</ul>

	</div>
Esempio n. 11
0
	</div>

	<div class="target-article media">
		<div class="target-header">
			<?php 
echo html_helper::anchor('classifieds/view/' . $ad['ad_id'] . '/' . text_helper::slug($ad['data_title'], 100), $ad['data_title']);
?>
 - <?php 
echo money_helper::symbol(config::item('ad_currency', 'classifieds')) . $ad['data_price'];
?>
		</div>
		<?php 
if ($ad['file_service_id'] && $ad['total_pictures']) {
    ?>
			<figure class="image classifieds-image">
				<div class="image thumbnail" style="background-image:url('<?php 
    echo storage_helper::getFileURL($ad['file_service_id'], $ad['file_path'], $ad['file_name'], $ad['file_ext'], 't', $ad['file_modify_date']);
    ?>
');">
					<?php 
    echo html_helper::anchor('classifieds/view/' . $ad['ad_id'] . '/' . text_helper::slug($ad['data_title'], 100), '<span class="name">' . $ad['data_title'] . '</span>', array('class' => 'image'));
    ?>
				</div>
			</figure>
		<?php 
}
?>
	</div>

</div>
Esempio n. 12
0
						</figure>

						<header class="item-header">
							<h3>
								<?php 
        echo html_helper::anchor('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), $blog['data_title']);
        ?>
							</h3>
						</header>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($blog['data_body'], isset($params['truncate']) && $params['truncate'] ? $params['truncate'] : config::item('blogs_preview_chars', 'blogs'));
        ?>
							<?php 
        echo html_helper::anchor('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), '&raquo;');
        ?>
						</div>

					</article>

				</li>

			<?php 
    }
    ?>

		</ul>

	</div>
Esempio n. 13
0
					</div>

				<?php 
    }
    ?>

			<?php 
}
?>

			<div class="row actions">
				<?php 
view::load('system/elements/button');
?>
				&nbsp;
				<?php 
echo html_helper::anchor('pictures/view/' . $picture['picture_id'] . '/' . text_helper::slug($picture['data_description'], 100), __('cancel', 'system'));
?>
			</div>

		</fieldset>

	<?php 
echo form_helper::closeForm(array('do_save_picture' => 1));
?>

</section>

<?php 
view::load('footer');
Esempio n. 14
0
 public function delete()
 {
     // Is user loggedin ?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     } elseif (!session::permission('pictures_post', 'classifieds')) {
         view::noAccess(session::item('slug'));
     }
     // Get URI vars
     $adID = (int) uri::segment(4);
     $pictureID = (int) uri::segment(5);
     // Get album
     if (!$adID || !($ad = $this->classifieds_model->getAd($adID, 'in_view')) || $ad['user_id'] != session::item('user_id')) {
         view::setError(__('no_ad', 'classifieds'));
         router::redirect('classifieds');
     }
     // Get picture
     if (!$pictureID || !($picture = $this->classifieds_pictures_model->getPicture($pictureID)) || $picture['ad_id'] != $adID) {
         view::setError(__('no_picture', 'classifieds'));
         router::redirect('classifieds/pictures/index/' . $adID . '/' . text_helper::slug($ad['data_title'], 100));
     }
     // Delete picture
     $this->classifieds_pictures_model->deletePicture($pictureID, $adID, session::item('user_id'), $picture, $ad);
     // Process query string
     $qstring = $this->parseQuerystring(config::item('pictures_per_page', 'classifieds'));
     // Success
     view::setInfo(__('picture_deleted', 'classifieds'));
     router::redirect('classifieds/pictures/index/' . $adID . '/' . text_helper::slug($ad['data_title'], 100) . '?' . $qstring['url'] . 'page=' . $qstring['page']);
 }