本文整理汇总了PHP中gallery类的典型用法代码示例。如果您正苦于以下问题:PHP gallery类的具体用法?PHP gallery怎么用?PHP gallery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了gallery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: admin_menu
public function admin_menu() {
$menu = Menu::factory("root");
gallery::admin_menu($menu, $this);
module::event("admin_menu", $menu, $this);
$menu->compact();
return $menu;
}
开发者ID:kovert,项目名称:gallery3,代码行数:7,代码来源:Admin_View.php
示例2: site_menu
public function site_menu()
{
$menu = Menu::factory("root");
gallery::site_menu($menu, $this);
module::event("site_menu", $menu, $this);
return $menu->compact();
}
开发者ID:eo04837,项目名称:gallery3,代码行数:7,代码来源:Theme_View.php
示例3: css
/**
* Add a css file to the combined css list.
* @param $file the file name or path of the script to include. If a path is specified then
* it needs to be relative to DOCROOT. Just specifying a file name will result
* in searching Kohana's cascading file system.
*/
public function css($file)
{
if ($path = gallery::find_file("css", $file, false)) {
$this->css[$path] = 1;
} else {
Kohana_Log::add("error", "Can't find css file: {$file}");
}
}
开发者ID:andyst,项目名称:gallery3,代码行数:14,代码来源:Gallery_View.php
示例4: __construct
/**
* Kohana 2.4 introduces a new connection parameter. If it's not specified, make sure that we
* define it here to avoid an error later on.
*
* @todo: add an upgrade path to modify var/database.php so that we can avoid doing this at
* runtime.
*/
protected function __construct(array $config)
{
if (!isset($config["connection"]["params"])) {
$config["connection"]["params"] = null;
}
parent::__construct($config);
if (gallery::show_profiler()) {
$this->config['benchmark'] = true;
}
}
开发者ID:HarriLu,项目名称:gallery3,代码行数:17,代码来源:MY_Database.php
示例5: index
public function index()
{
$input = Input::instance();
$reply = GalleryRemoteReply::factory(gallery_remote::GR_STAT_SUCCESS);
if ($this->_check_protocol($input, $reply)) {
$reply->set('debug_gallery_version', gallery::version_string());
$reply->set('debug_user', identity::active_user()->name);
$reply->set('debug_user_type', 'Gallery_User');
$reply->set('debug_user_already_logged_in', identity::active_user()->id != identity::guest()->id ? '1' : '');
$reply->set('server_version', '2.15');
$cmd = trim($input->post('cmd'));
if ($cmd == 'login') {
$this->_login($input, $reply);
} else {
if (self::isloggedin()) {
switch ($cmd) {
case 'no-op':
$reply->set('status_text', 'Noop command successful.');
$reply->send();
break;
case 'fetch-albums':
case 'fetch-albums-prune':
$this->_fetch_albums_prune($input, $reply);
break;
case 'new-album':
$this->_new_album($input, $reply);
break;
case 'album-properties':
$this->_album_properties($input, $reply);
break;
case 'add-item':
$this->_add_item($input, $reply);
break;
case 'move-album':
$this->_move_album($input, $reply);
break;
case 'increment-view-count':
$this->_increment_view_count($input, $reply);
break;
case 'image-properties':
$this->_image_properties($input, $reply);
break;
case 'fetch-album-images':
$this->_fetch_album_images($input, $reply);
break;
default:
$reply->send(gallery_remote::UNKNOWN_CMD);
}
} else {
$reply->send(gallery_remote::LOGIN_MISSING);
}
}
}
}
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:54,代码来源:gallery_remote.php
示例6: css
/**
* If css combining is enabled, add this css to the list of css that will be
* combined into a single style element. When combined, the order of style elements
* is preserved.
*
* @param $file the file name or path of the css to include. If a path is specified then
* it needs to be relative to DOCROOT. Just specifying a file name will result
* in searching Kohana's cascading file system.
* @param $group the group of css to combine this with. defaults to "core"
*/
public function css($file, $group = "core")
{
if ($path = gallery::find_file("css", $file, false)) {
if (isset($this->combine_queue["css"])) {
$this->combine_queue["css"][$group][$path] = 1;
} else {
return html::stylesheet($path);
}
} else {
Kohana_Log::add("error", "Can't find css file: {$file}");
}
}
开发者ID:Joe7,项目名称:gallery3,代码行数:22,代码来源:Gallery_View.php
示例7: activate
static function activate()
{
gallery::set_path_env(array(getenv("PATH"), module::get_var("gallery", "extra_binary_paths")));
$exiv = exec('which exiv2');
if ($exiv == '') {
# Proper warning
} else {
module::set_var("author", "exiv_path", $exiv);
$out = array();
exec("{$exiv} -V", $out);
$parts = split(' ', $out[0]);
module::set_var("author", "exiv_version", $parts[1]);
}
}
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:14,代码来源:author_installer.php
示例8: report_item_conversion_support
static function report_item_conversion_support()
{
if (gallery::RELEASE_CHANNEL == "release") {
if (version_compare(gallery::VERSION, rawphoto_version::MIN_RELEASE_VERSION, ">=")) {
site_status::clear("rawphoto_needs_item_conversion_support");
} else {
site_status::warning(t("The <em>Raw Photos</em> module requires Gallery %version or higher.", array("version" => rawphoto_version::MIN_RELEASE_VERSION)), "rawphoto_needs_item_conversion_support");
}
} else {
if (version_compare(gallery::build_number(), rawphoto_version::MIN_BUILD_NUMBER, ">=")) {
site_status::clear("rawphoto_needs_item_conversion_support");
} else {
site_status::warning(t("The <em>Raw Photos</em> module requires Gallery %version, build %build_number or higher.", array("version" => gallery::VERSION, "build_number" => rawphoto_version::MIN_BUILD_NUMBER)), "rawphoto_needs_item_conversion_support");
}
}
}
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:16,代码来源:rawphoto_version.php
示例9: add_image
/**
* Add image to item
* @return void
* @param integer id of item
* @param string dir with images
*/
public function add_image($item, $dir)
{
// Check for user permission
if (user::is_got()) {
$this->set_title(Kohana::lang('gallery.add_image'));
$this->add_breadcrumb(Kohana::lang('gallery.add_image'), url::current());
// Set redirect URL
if (isset($_POST['redirect'])) {
$redirect = $_POST['redirect'];
} else {
$redirect = request::referrer();
}
$form = array('image' => '', 'redirect' => $redirect);
$errors = array();
if (isset($_FILES)) {
$files = new Validation($_FILES);
// Rules
$files->add_rules('image', 'upload::valid', 'upload::required', 'upload::type[jpg,jpeg]', 'upload::size[500K]');
if ($files->validate()) {
// Temporary file
$filename = upload::save('image');
// Get new name
$id = gallery::get_image_new_name($item, $dir);
// Save original and thumb
Image::factory($filename)->save('./data/' . $dir . '/' . $item . '_' . $id . '.jpg');
Image::factory($filename)->resize(128, 128, Image::AUTO)->quality(85)->save('./data/' . $dir . '/' . $item . '_' . $id . '_m.jpg');
// Remove the temporary file
unlink($filename);
url::redirect($form['redirect']);
} else {
// Repopulate form with error and original values
$form = arr::overwrite($form, $files->as_array());
$errors = $files->errors('gallery_errors');
}
}
// View
$this->template->content = new View('admin/add_image');
$this->template->content->errors = $errors;
$this->template->content->form = $form;
} else {
url::redirect('/denied');
}
}
开发者ID:repli2dev,项目名称:re-eshop,代码行数:49,代码来源:gallery.php
示例10: get
static function get($block_id, $theme)
{
$block = "";
switch ($block_id) {
case "metadata":
if ($theme->item()) {
$block = new Block();
$block->css_id = "g-metadata";
$block->title = $theme->item()->is_album() ? t("Album info") : ($theme->item()->is_movie() ? t("Movie info") : t("Photo info"));
$block->content = new View("info_block.html");
if ($theme->item->title && module::get_var("info", "show_title")) {
$info["title"] = array("label" => t("Title:"), "value" => html::purify($theme->item->title));
}
if ($theme->item->description && module::get_var("info", "show_description")) {
$info["description"] = array("label" => t("Description:"), "value" => nl2br(html::purify($theme->item->description)));
}
if (!$theme->item->is_album() && module::get_var("info", "show_name")) {
$info["file_name"] = array("label" => t("File name:"), "value" => html::clean($theme->item->name));
}
if ($theme->item->captured && module::get_var("info", "show_captured")) {
$info["captured"] = array("label" => t("Captured:"), "value" => gallery::date_time($theme->item->captured));
}
if ($theme->item->owner && module::get_var("info", "show_owner")) {
$display_name = $theme->item->owner->display_name();
if ($theme->item->owner->url) {
$info["owner"] = array("label" => t("Owner:"), "value" => html::anchor(html::clean($theme->item->owner->url), html::clean($display_name)));
} else {
$info["owner"] = array("label" => t("Owner:"), "value" => html::clean($display_name));
}
}
if ($theme->item->width && $theme->item->height && module::get_var("info", "show_dimensions")) {
$info["size"] = array("label" => t("Dimensions:"), "value" => t("%width x %height px", array("width" => $theme->item->width, "height" => $theme->item->height)));
}
$block->content->metadata = $info;
module::event("info_block_get_metadata", $block, $theme->item);
}
break;
}
return $block;
}
开发者ID:qboy1987,项目名称:mooiyou,代码行数:40,代码来源:info_block.php
示例11: get
static function get($block_id, $theme)
{
$block = new Block();
switch ($block_id) {
case "simple":
$item = $theme->item;
if (!$item or !$item->is_photo()) {
return "";
}
$block->css_id = "g-about-this-photo";
$block->title = t("About this photo");
$block->content = new View("about_this_photo.html");
// exif API doesn't give easy access to individual keys, so do this the hard way
if (module::is_active("exif")) {
$exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find();
if ($exif->loaded()) {
$exif = unserialize($exif->data);
$timestamp = strtotime($exif["DateTime"]);
//$block->content->date = gallery::date($timestamp);
$block->content->date = date('D j M Y', $timestamp);
$block->content->time = gallery::time($timestamp);
}
}
$block->content->vcount = $theme->item()->view_count;
// IPTC - copied more or less from iptc.php
if (module::is_active("iptc")) {
$record = ORM::factory("iptc_record")->where("item_id", "=", $theme->item()->id)->find();
if ($record->loaded()) {
$record = unserialize($record->data);
$block->content->source = $record["Source"];
$block->content->caption = $record["Caption"];
}
}
if (module::is_active("tag")) {
$block->content->tags = tag::item_tags($theme->item());
}
break;
}
return $block;
}
开发者ID:Retroguy,项目名称:gallery3-contrib,代码行数:40,代码来源:about_this_photo_block.php
示例12: reply
static function reply($data = array())
{
Session::instance()->abort_save();
header("X-Gallery-API-Version: " . rest::API_VERSION);
switch (Input::instance()->get("output", "json")) {
case "json":
json::reply($data);
break;
case "jsonp":
if (!($callback = Input::instance()->get("callback", ""))) {
throw new Rest_Exception("Bad Request", 400, array("errors" => array("callback" => "missing")));
}
if (preg_match('/^[$A-Za-z_][0-9A-Za-z_]*$/', $callback) == 1) {
header("Content-type: application/javascript; charset=UTF-8");
print "{$callback}(" . json_encode($data) . ")";
} else {
throw new Rest_Exception("Bad Request", 400, array("errors" => array("callback" => "invalid")));
}
break;
case "html":
header("Content-type: text/html; charset=UTF-8");
if ($data) {
$html = preg_replace("#([\\w]+?://[\\w]+[^ \\'\"\n\r\t<]*)#ise", "'<a href=\"\\1\" >\\1</a>'", var_export($data, 1));
} else {
$html = t("Empty response");
}
print "<pre>{$html}</pre>";
if (gallery::show_profiler()) {
Profiler::enable();
$profiler = new Profiler();
$profiler->render();
}
break;
default:
throw new Rest_Exception("Bad Request", 400);
}
}
开发者ID:HarriLu,项目名称:gallery3,代码行数:37,代码来源:rest.php
示例13: get
static function get($block_id, $theme)
{
$block = "";
switch ($block_id) {
case "metadata":
if ($theme->item()) {
$block = new Block();
$block->css_id = "g-metadata";
$block->title = $theme->item()->is_album() ? t("Album info") : t("Photo info");
$block->content = new View("info_block.html");
if ($theme->item->title && module::get_var("info", "show_title")) {
$info["title"] = array("label" => t("Title:"), "value" => html::purify($theme->item->title));
}
if ($theme->item->description && module::get_var("info", "show_description")) {
$info["description"] = array("label" => t("Description:"), "value" => nl2br(html::purify($theme->item->description)));
}
if (!$theme->item->is_album() && module::get_var("info", "show_name")) {
$info["file_name"] = array("label" => t("File name:"), "value" => html::clean($theme->item->name));
}
if ($theme->item->captured && module::get_var("info", "show_captured")) {
$info["captured"] = array("label" => t("Captured:"), "value" => gallery::date_time($theme->item->captured));
}
if ($theme->item->owner && module::get_var("info", "show_owner")) {
$display_name = $theme->item->owner->display_name();
if ($theme->item->owner->url) {
$info["owner"] = array("label" => t("Owner:"), "value" => "<a href=\"{$theme->item->owner->url}\">" . html::clean($display_name) . "</a>");
} else {
$info["owner"] = array("label" => t("Owner:"), "value" => html::clean($display_name));
}
}
$block->content->metadata = $info;
module::event("info_block_get_metadata", $block, $theme->item);
}
break;
}
return $block;
}
开发者ID:kandsten,项目名称:gallery3,代码行数:37,代码来源:info_block.php
示例14: tag_ItemList
/**
* Display list of items associated with page and of specified type
*
* @param array $tag_params
* @param array $children
*/
public function tag_ItemList($tag_params, $children, $type)
{
$manager = UserPageItemsManager::getInstance();
$page_id = isset($tag_params['page']) ? fix_id($tag_params['page']) : null;
// create query conditions
$conditions = array();
if (!is_null($page_id)) {
$conditions['page'] = $page_id;
}
$conditions['type'] = $type;
// get items from database
$items = $manager->getItems(array('id', 'item'), $conditions);
if ($type == user_page::VIDEO) {
// create template
$template = $this->loadTemplate($tag_params, 'page_items_video.xml');
// connect tag handlers
if (class_exists('youtube')) {
$module = youtube::getInstance();
$template->registerTagHandler('_video', $module, 'tag_Video');
}
} else {
// create template
$template = $this->loadTemplate($tag_params, 'page_items_gallery.xml');
// connect tag handlers
if (class_exists('gallery')) {
$module = gallery::getInstance();
$template->registerTagHandler('_gallery', $module, 'tag_Group');
}
}
// parse items
if (count($items) > 0) {
foreach ($items as $item) {
$params = array('item' => $item->item, 'item_delete' => url_MakeHyperlink($this->getLanguageConstant('delete'), window_Open('user_pages_items_delete', 400, $this->getLanguageConstant('title_delete_page'), false, false, url_Make('transfer_control', 'backend_module', array('module', $this->name), array('backend_action', 'page_items_delete'), array('id', $item->id)))));
$template->restoreXML();
$template->setLocalParams($params);
$template->parse();
}
}
}
开发者ID:tareqy,项目名称:Caracal,代码行数:45,代码来源:user_page.php
示例15: credits
static function credits()
{
$version_string = SafeString::of_safe_html('<bdo dir="ltr">Gallery ' . gallery::version_string() . '</bdo>');
return "<li class=\"g-first\">" . t(module::get_var("gallery", "credits"), array("url" => "http://gallery.menalto.com", "gallery_version" => $version_string)) . "</li>";
}
开发者ID:Joe7,项目名称:gallery3,代码行数:5,代码来源:gallery_theme.php
示例16: t
echo p::clean($user->name);
?>
</td>
<td>
<?php
echo p::clean($user->full_name);
?>
</td>
<td>
<?php
echo p::clean($user->email);
?>
</td>
<td>
<?php
echo $user->last_login == 0 ? "" : gallery::date($user->last_login);
?>
</td>
<td class="gActions">
<a href="<?php
echo url::site("admin/users/edit_user_form/{$user->id}");
?>
"
open_text="<?php
echo t("close");
?>
"
class="gPanelLink gButtonLink ui-state-default ui-corner-all ui-icon-left">
<span class="ui-icon ui-icon-pencil"></span><span class="gButtonText"><?php
echo t("edit");
?>
开发者ID:kstyrvoll,项目名称:gallery3,代码行数:31,代码来源:admin_users.html.php
示例17: site_menu
static function site_menu($menu, $theme)
{
if ($theme->page_type != "login") {
$menu->append(Menu::factory("link")->id("home")->label(t("Home"))->url(url::site("albums/1")));
$item = $theme->item();
$can_edit = $item && access::can("edit", $item);
$can_add = $item && access::can("add", $item);
if ($can_add) {
$menu->append($add_menu = Menu::factory("submenu")->id("add_menu")->label(t("Add")));
$add_menu->append(Menu::factory("dialog")->id("add_photos_item")->label(t("Add photos"))->url(url::site("simple_uploader/app/{$item->id}")));
if ($item->is_album()) {
$add_menu->append(Menu::factory("dialog")->id("add_album_item")->label(t("Add an album"))->url(url::site("form/add/albums/{$item->id}?type=album")));
}
}
$menu->append($options_menu = Menu::factory("submenu")->id("options_menu")->label(t("Photo options")));
if ($item && ($can_edit || $can_add)) {
if ($can_edit) {
$options_menu->append(Menu::factory("dialog")->id("edit_item")->label($item->is_album() ? t("Edit album") : t("Edit photo"))->url(url::site("form/edit/{$item->type}s/{$item->id}")));
}
if ($item->is_album()) {
$options_menu->label(t("Album options"));
if ($can_edit) {
$options_menu->append(Menu::factory("dialog")->id("edit_permissions")->label(t("Edit permissions"))->url(url::site("permissions/browse/{$item->id}")));
}
}
}
if (user::active()->admin) {
$menu->append($admin_menu = Menu::factory("submenu")->id("admin_menu")->label(t("Admin")));
gallery::admin_menu($admin_menu, $theme);
module::event("admin_menu", $admin_menu, $theme);
}
module::event("site_menu", $menu, $theme);
}
}
开发者ID:Okat,项目名称:gallery3,代码行数:34,代码来源:gallery.php
示例18: foreach
</tr>
<? $i = 0; ?>
<? foreach ($finished_tasks as $task): ?>
<tr class="<?php
echo $i % 2 == 0 ? "g-odd" : "g-even";
?>
<?php
echo $task->state == "success" ? "g-success" : "g-error";
?>
">
<td class="<?php
echo $task->state == "success" ? "g-success" : "g-error";
?>
">
<?php
echo gallery::date_time($task->updated);
?>
</td>
<td>
<?php
echo $task->name;
?>
</td>
<td>
<? if ($task->state == "success"): ?>
<?php
echo t("Success");
?>
<? elseif ($task->state == "error"): ?>
<?php
echo t("Failed");
开发者ID:ChrisRut,项目名称:gallery3,代码行数:31,代码来源:admin_maintenance.html.php
示例19: setTimeout
document.write("<scr" + "ipt type=\"text/javascript\" src=\"<?php
echo url::base(false) . gallery::find_file("js", "jquery.js", false);
?>
\"></scr" + "ipt>");
document.write("<scr" + "ipt type=\"text/javascript\" src=\"<?php
echo url::base(false) . gallery::find_file("js", "jquery.tagcanvas.mod.min.js", false);
?>
\"></scr" + "ipt>");
};
setTimeout("initScripts()", 50);
} else if (typeof(jQuery().tagcanvas) == 'undefined') {
if (!jQueryTagCanvasScriptFlag) {
// load one script
jQueryTagCanvasScriptFlag = true;
document.write("<scr" + "ipt type=\"text/javascript\" src=\"<?php
echo url::base(false) . gallery::find_file("js", "jquery.tagcanvas.mod.min.js", false);
?>
\"></scr" + "ipt>");
};
setTimeout("initScripts()", 50);
} else {
// libraries loaded - run actual code
function redraw() {
// set g-tag-cloud-html5-embed-canvas size
$("#g-tag-cloud-html5-embed-canvas").attr({
'width' : $("#g-tag-cloud-html5-embed").parent().width(),
'height': $("#g-tag-cloud-html5-embed").parent().height()
});
// start g-tag-cloud-html5-embed-canvas
if(!$('#g-tag-cloud-html5-embed-canvas').tagcanvas(<?php
echo $options;
开发者ID:webmatter,项目名称:gallery3-contrib,代码行数:31,代码来源:tag_cloud_html5_embed.html.php
示例20: delete
/**
* Delete product
* @param integer id of product
* @return void
*/
public function delete($id)
{
// Check user permission
if (user::is_got()) {
// Settings
$this->set_title(Kohana::lang('eshop.delete_product'));
$this->add_breadcrumb(Kohana::lang('eshop.delete_product'), url::current());
if ($_POST) {
if (isset($_POST['yes'])) {
// clicked on yes = delete
$cat = $this->products->get_product_cat($id);
$cat = $cat[0];
$status = $this->products->delete_data($id);
// Also delte images if deletition was successful
if ($status == TRUE) {
gallery::delete_images($id, 'products');
}
url::redirect('/cat/' . $cat . '/' . cat::get_name($cat));
} else {
url::redirect('/product/' . $id . '/' . string::to_url(product::get_name($id)));
}
}
// page
$this->template->content = new View('admin/product_delete');
} else {
url::redirect('/denied');
}
}
开发者ID:repli2dev,项目名称:re-eshop,代码行数:33,代码来源:product.php
注:本文中的gallery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论