本文整理汇总了PHP中site_status::warning方法的典型用法代码示例。如果您正苦于以下问题:PHP site_status::warning方法的具体用法?PHP site_status::warning怎么用?PHP site_status::warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类site_status
的用法示例。
在下文中一共展示了site_status::warning方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirm
public function confirm($hash)
{
$pending_user = ORM::factory("pending_user")->where("hash", "=", $hash)->where("state", "=", 0)->find();
if ($pending_user->loaded()) {
// @todo add a request date to the pending user table and check that it hasn't expired
$policy = module::get_var("registration", "policy");
$pending_user->state = 1;
$pending_user->save();
if ($policy == "vistor") {
$user = register::create_new_user($pending_user->id);
message::success(t("Your registration request has been approved"));
auth::login($user);
Session::instance()->set("registration_first_usage", true);
$pending_user->delete();
} else {
site_status::warning(t("There are pending user registration. <a href=\"%url\">Review now!</a>", array("url" => html::mark_clean(url::site("admin/register")), "locale" => module::get_var("gallery", "default_locale"))), "pending_user_registrations");
message::success(t("Your registration request is awaiting administrator approval"));
// added by Shad Laws, v2
if (module::get_var("registration", "admin_notify") == 1) {
register::send_admin_notify($pending_user);
}
}
} else {
message::error(t("Your registration request is no longer valid, Please re-register."));
}
url::redirect(item::root()->abs_url());
}
示例2: upgrade
static function upgrade($version)
{
log::info("aws_s3", "Commencing module upgrade (" . $version . ")");
switch ($version) {
case 0:
log::info("aws_s3", "Installing version 1");
@mkdir(VARPATH . "modules/aws_s3");
@mkdir(VARPATH . "modules/aws_s3/log");
// installation's unique identifier - allows multiple g3's pointing to the same s3 bucket.
if (!module::get_var("aws_s3", "g3id")) {
module::set_var("aws_s3", "g3id", md5(time()));
}
module::set_var("aws_s3", "synced", false);
module::set_var("aws_s3", "enabled", false);
module::set_var("aws_s3", "access_key", "");
module::set_var("aws_s3", "secret_key", "");
module::set_var("aws_s3", "bucket_name", "");
module::set_version("aws_s3", 1);
case 1:
log::info("aws_s3", "Upgrading to version 2");
$db = Database::instance();
$db->query("CREATE TABLE {aws_s3_meta} (\n `item_id` int(9) NOT NULL,\n `item_hash` varchar(32) NOT NULL DEFAULT '',\n `thumb_uploaded` smallint(1) NOT NULL DEFAULT 0,\n `resize_uploaded` smallint(1) NOT NULL DEFAULT 0,\n `fullsize_uploaded` smallint(1) NOT NULL DEFAULT 0,\n `local_deleted` smallint(1) NOT NULL DEFAULT 0,\n PRIMARY KEY (`item_id`)\n ) DEFAULT CHARSET=utf8;");
module::set_var("aws_s3", "upload_thumbs", true);
module::set_var("aws_s3", "upload_resizes", true);
module::set_var("aws_s3", "upload_fullsizes", true);
module::set_var("aws_s3", "s3_storage_only", false);
if (module::get_var("aws_s3", "synced")) {
// v1 has already synced this installation to s3. mark all the items with the relevant meta data
$items = ORM::factory("item")->find_all();
foreach ($items as $item) {
aws_s3::log("Updating S3 meta for item ID: " . $item->id);
$item->s3_thumb_uploaded = true;
if (!$item->is_album()) {
$item->s3_resize_uploaded = true;
$item->s3_fullsize_uploaded = true;
}
$item->s3_local_deleted = false;
$item->s3_item_hash = md5($item->relative_path());
$item->save_s3_meta();
}
} else {
// check various states after upgrade from v1..
if (module::get_var("aws_s3", "access_key") != "" && module::get_var("aws_s3", "secret_key") != "" && module::get_var("aws_s3", "bucket_name") != "" && aws_s3::validate_access_details(module::get_var("aws_s3", "access_key"), module::get_var("aws_s3", "secret_key"), module::get_var("aws_s3", "bucket_name"))) {
// details are correct but hasn't been synced.
if (aws_s3::can_schedule()) {
// i can schedule this task
aws_s3::schedule_full_sync2();
site_status::warning("Your site has been scheduled for full Amazon S3 re-synchronisation. This message will clear when this has been completed.", "aws_s3_not_synced");
} else {
// i CAN'T schedule it..
site_status::warning(t('Your site has not been synchronised to Amazon S3. Until it has, your server will continue to serve image content to your visitors.<br />Click <a href="%url" class="g-dialog-link">here</a> to start the synchronisation task.', array("url" => html::mark_clean(url::site("admin/maintenance/start/aws_s3_task::manual_sync?csrf=__CSRF__")))), "aws_s3_not_synced");
}
} else {
site_status::warning(t('Amazon S3 module needs configuration. Click <a href="%url">here</a> to go to the configuration page.', array("url" => html::mark_clean(url::site("admin/aws_s3")))), "aws_s3_not_configured");
}
}
module::set_version("aws_s3", 2);
}
log::info("aws_s3", "Module upgrade complete");
}
示例3: check_index
/**
* @return string An error message suitable for inclusion in the task log
*/
static function check_index()
{
list($remaining) = search::stats();
if ($remaining) {
site_status::warning(t('Your search index needs to be updated. <a href="%url" class="g-dialog-link">Fix this now</a>', array("url" => html::mark_clean(url::site("admin/maintenance/start/search_task::update_index?csrf=__CSRF__")))), "search_index_out_of_date");
}
}
示例4: index
public function index()
{
// require_once(MODPATH . "aws_s3/lib/s3.php");
$form = $this->_get_s3_form();
if (request::method() == "post") {
access::verify_csrf();
if ($form->validate()) {
module::set_var("aws_s3", "enabled", isset($_POST['enabled']) ? true : false);
module::set_var("aws_s3", "access_key", $_POST['access_key']);
module::set_var("aws_s3", "secret_key", $_POST['secret_key']);
module::set_var("aws_s3", "bucket_name", $_POST['bucket_name']);
module::set_var("aws_s3", "g3id", $_POST['g3id']);
module::set_var("aws_s3", "url_str", $_POST['url_str']);
module::set_var("aws_s3", "sig_exp", $_POST['sig_exp']);
module::set_var("aws_s3", "use_ssl", isset($_POST['use_ssl']) ? true : false);
if (module::get_var("aws_s3", "enabled") && !module::get_var("aws_s3", "synced", false)) {
site_status::warning(t('Your site has not yet been syncronised with your Amazon S3 bucket. Content will not appear correctly until you perform syncronisation. <a href="%url" class="g-dialog-link">Fix this now</a>', array("url" => html::mark_clean(url::site("admin/maintenance/start/aws_s3_task::sync?csrf=__CSRF__")))), "aws_s3_not_synced");
}
message::success(t("Settings have been saved"));
url::redirect("admin/aws_s3");
} else {
message::error(t("There was a problem with the submitted form. Please check your values and try again."));
}
}
$v = new Admin_View("admin.html");
$v->page_title = t("Amazon S3 Configuration");
$v->content = new View("admin_aws_s3.html");
$v->content->form = $form;
$v->content->end = "";
echo $v;
}
示例5: report_ppm_support
static function report_ppm_support($toolkit_id)
{
if (array_key_exists($toolkit_id, rawphoto_graphics::get_supported_toolkits())) {
site_status::clear("rawphoto_needs_ppm_support");
} else {
site_status::warning(t('The <em>Raw Photos</em> module requires a supporting graphics toolkit. ' . '<a href="%activate_url">Activate</a> either ImageMagick or GraphicsMagick.', array("activate_url" => url::site("admin/graphics"))), "rawphoto_needs_ppm_support");
}
}
示例6: module_change
static function module_change($changes)
{
if (!module::is_active("rss") || in_array("rss", $changes->deactivate)) {
site_status::warning(t("The Slideshow module requires the RSS module. <a href=\"%url\">Activate the RSS module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "slideshow_needs_rss");
} else {
site_status::clear("slideshow_needs_rss");
}
}
示例7: module_change
static function module_change($changes)
{
// Gallery version must be >= 32
if (module::get_version("gallery") < 32) {
site_status::warning(t("The module 'Module Order' requires Gallery core version of 32 or higher."), "moduleorder_needs_higherversion");
} else {
site_status::clear("moduleorder_needs_higherversion");
}
}
示例8: module_change
static function module_change($changes)
{
// Display a warning message if the RSS module is not installed.
if (!module::is_active("rss") || in_array("rss", $changes->deactivate)) {
site_status::warning(t("The MiniSlide Show module requires the RSS module. " . "<a href=\"%url\">Activate the RSS module now</a>", array("url" => url::site("admin/modules"))), "minislideshow_needs_rss");
} else {
site_status::clear("minislideshow_needs_rss");
}
}
示例9: module_change
static function module_change($changes)
{
// If EXIF is deactivated, display a warning that it is required for this module to function properly.
if (!module::is_active("exif") || in_array("exif", $changes->deactivate)) {
site_status::warning(t("The EXIF_GPS module requires the EXIF module. " . "<a href=\"%url\">Activate the EXIF module now</a>", array("url" => html::mark_clean(url::site("admin/modules")))), "exif_gps_needs_exif");
} else {
site_status::clear("exif_gps_needs_exif");
}
}
示例10: check_config
static function check_config()
{
$public_key = module::get_var("recaptcha", "public_key");
$private_key = module::get_var("recaptcha", "private_key");
if (empty($public_key) || empty($private_key)) {
site_status::warning(t("reCAPTCHA is not quite ready! Please configure the <a href=\"%url\">reCAPTCHA Keys</a>", array("url" => html::mark_clean(url::site("admin/recaptcha")))), "recaptcha_config");
} else {
site_status::clear("recaptcha_config");
}
}
示例11: check_config
static function check_config($paths = null)
{
if ($paths === null) {
$paths = unserialize(module::get_var("videos", "authorized_paths"));
}
if (empty($paths)) {
site_status::warning(t("Videos needs configuration. <a href=\"%url\">Configure it now!</a>", array("url" => html::mark_clean(url::site("admin/videos")))), "videos_configuration");
} else {
site_status::clear("videos_configuration");
}
}
示例12: check_config
static function check_config($paths = null)
{
if ($paths === null) {
$paths = unserialize(module::get_var("server_add", "authorized_paths"));
}
if (empty($paths)) {
site_status::warning(t("Server Add needs configuration. <a href=\"%url\">Configure it now!</a>", array("url" => url::site("admin/server_add"))), "server_add_configuration");
} else {
site_status::clear("server_add_configuration");
}
}
示例13: activate
static function activate()
{
site_status::warning(t("Activate."), "gd_init_configuration");
if (module::get_var("gallery", "resize_size") != 800) {
module::set_var("gallery", "resize_size", 800);
}
if (module::get_var("gallery", "thumb_size") != 200) {
module::set_var("gallery", "thumb_size", 200);
}
if (module::get_var("gallery", "page_size") != 50) {
module::set_var("gallery", "page_size", 50);
}
}
示例14: module_change
static function module_change($changes)
{
// See if the Tags module is installed,
// tell the user to install it if it isn't.
if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) {
site_status::warning(t("The Photo Annotation module requires the Tags module. " . "<a href=\"%url\">Activate the Tags module now</a>", array("url" => url::site("admin/modules"))), "photoannotation_needs_tag");
} else {
site_status::clear("photoannotation_needs_tag");
}
if (module::is_active("tagfaces") || in_array("tagfaces", $changes->activate)) {
site_status::warning(t("The Photo Annotation module cannot be used together with the TagFaces module. " . "<a href=\"%url\">Dectivate the TagFaces module now</a>", array("url" => url::site("admin/modules"))), "photoannotation_incompatibility_tagfaces");
} else {
site_status::clear("photoannotation_incompatibility_tagfaces");
}
}
示例15: 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");
}
}
}