本文整理汇总了PHP中Photo::form方法的典型用法代码示例。如果您正苦于以下问题:PHP Photo::form方法的具体用法?PHP Photo::form怎么用?PHP Photo::form使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Photo
的用法示例。
在下文中一共展示了Photo::form方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public function get()
{
if (!\Current_User::allow('properties')) {
\Current_User::disallow('Action not allowed.');
}
switch ($_GET['aop']) {
case 'delete_contact':
if (!\Current_User::authorized('properties')) {
\Current_User::disallow();
} else {
$this->loadContact();
try {
$this->contact->delete();
} catch (\Exception $e) {
\PHPWS_Error::log($e->getMessage());
$this->message = 'An error occurred when trying to delete a contact.';
}
}
case 'update':
$this->loadProperty();
$this->property->update();
\PHPWS_Core::goBack();
break;
case 'show_properties':
$this->panel->setCurrentTab('properties');
$this->loadContact();
$this->contactPropertiesList($_GET['cid']);
break;
case 'contacts':
$this->title = 'Contacts list';
$this->contactList();
break;
case 'photo_form':
$photo = new Photo();
echo $photo->form();
exit;
break;
case 'edit_contact':
$this->loadContact();
$this->editContact();
break;
case 'edit_property':
$this->loadProperty();
if (isset($_GET['cid'])) {
$this->property->contact_id = $_GET['cid'];
}
$this->editProperty();
break;
case 'email_contacts':
$this->emailContacts();
break;
case 'activate_contact':
if (!\Current_User::authorized('properties')) {
\Current_User::disallow();
}
$this->loadContact();
$this->contact->setActive(true);
$this->contact->save();
\PHPWS_Core::goBack();
break;
case 'show_blocked':
$_SESSION['prop_show_blocked'] = 1;
$this->viewReported();
break;
case 'hide_blocked':
unset($_SESSION['prop_show_blocked']);
$this->viewReported();
break;
case 'deactivate_contact':
if (!\Current_User::authorized('properties')) {
\Current_User::disallow();
}
$this->loadContact();
$this->contact->setActive(false);
$this->contact->save();
\PHPWS_Core::goBack();
break;
case 'activate_property':
if (!\Current_User::authorized('properties')) {
\Current_User::disallow();
}
$this->loadProperty();
$this->property->setActive(true);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'reported':
$this->viewReported();
break;
case 'deactivate_property':
if (!\Current_User::authorized('properties')) {
\Current_User::disallow();
}
$this->loadProperty();
$this->property->setActive(false);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'delete_photo':
// called via ajax
//.........这里部分代码省略.........
示例2: get
public function get()
{
$this->loadContact();
switch ($_GET['cop']) {
case 'logout':
unset($_SESSION['Contact_User']);
\PHPWS_Core::home();
break;
case 'edit_property':
$this->checkPermission();
$this->loadProperty($this->contact->id);
$this->editProperty($this->contact->id);
break;
case 'view_properties':
$this->checkPermission();
$this->title = "Properties list";
$this->propertiesList($this->contact->id);
break;
case 'photo_form':
$photo = new Photo();
echo $photo->form();
exit;
break;
case 'activate_property':
$this->checkPermission();
$this->loadProperty();
$this->property->setActive(true);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'deactivate_property':
$this->checkPermission();
$this->loadProperty();
$this->property->setActive(false);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'edit_contact':
$this->checkPermission();
$this->editContact();
break;
case 'delete_photo':
// called via ajax
$this->checkPermission();
ob_start();
$photo = new Photo($_GET['id']);
$photo->delete();
echo Photo::getThumbs($photo->pid);
exit;
break;
case 'delete_property':
$this->checkPermission();
$this->loadProperty();
// double security
if ($this->property->contact_id == $this->contact->id) {
$this->property->delete();
}
\PHPWS_Core::goBack();
break;
case 'make_main':
$photo = new Photo($_GET['id']);
$photo->makeMain();
exit;
break;
case 'update':
$this->checkPermission();
$this->loadProperty();
$this->property->update();
\PHPWS_Core::goBack();
break;
}
$this->display();
}
示例3: get
public function get()
{
$this->loadContact();
switch ($_GET['cop']) {
case 'logout':
unset($_SESSION['Contact_User']);
\PHPWS_Core::home();
break;
case 'manager_sign_up':
if (!self::allowNewUserSignup()) {
$this->title = 'Sorry';
$this->content = '<p>New manager sign ups are not permitted at this time.</p>';
} else {
$this->newManagerSetup();
}
break;
case 'edit_property':
$this->checkPermission();
$this->loadProperty($this->contact->id);
$this->editProperty($this->contact->id);
break;
case 'view_properties':
$this->checkPermission();
$this->title = "Properties list";
$this->propertiesList($this->contact->id);
break;
case 'photo_form':
$photo = new Photo();
echo $photo->form();
exit;
break;
case 'activate_property':
$this->checkPermission();
$this->loadProperty();
$this->property->setActive(true);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'deactivate_property':
$this->checkPermission();
$this->loadProperty();
$this->property->setActive(false);
$this->property->save();
\PHPWS_Core::goBack();
break;
case 'edit_contact':
$this->checkPermission();
$this->editContact();
break;
case 'delete_photo':
// called via ajax
$this->checkPermission();
ob_start();
$photo = new Photo($_GET['id']);
$photo->delete();
echo Photo::getThumbs($photo->pid);
exit;
break;
case 'delete_property':
$this->checkPermission();
$this->loadProperty();
// double security
if ($this->property->contact_id == $this->contact->id) {
$this->property->delete();
}
\PHPWS_Core::goBack();
break;
case 'make_main':
$photo = new Photo($_GET['id']);
$photo->makeMain();
exit;
break;
case 'update':
$this->checkPermission();
$this->loadProperty();
$this->property->update();
\PHPWS_Core::goBack();
break;
case 'checkUsername':
$this->checkUsername();
exit;
case 'checkEmail':
$this->checkEmail();
exit;
}
$this->display();
}