[GNUsocialProfileExtensions] Fixed plugin
This commit is contained in:
parent
01cf8ab82c
commit
90bd9088bb
@ -16,6 +16,7 @@
|
|||||||
"ext-simplexml": "*",
|
"ext-simplexml": "*",
|
||||||
"ext-xml": "*",
|
"ext-xml": "*",
|
||||||
"ext-xmlwriter": "*",
|
"ext-xmlwriter": "*",
|
||||||
|
"ext-ctype": "*",
|
||||||
"apereo/phpcas": "^1.3",
|
"apereo/phpcas": "^1.3",
|
||||||
"diogocomposer/xmpphp": "^3.0",
|
"diogocomposer/xmpphp": "^3.0",
|
||||||
"embed/embed": "^3.4",
|
"embed/embed": "^3.4",
|
||||||
|
@ -87,8 +87,8 @@ class NoticeForm extends Form
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param Action $action Action we're being embedded into
|
* @param Action $action Action we're being embedded into
|
||||||
* @param array $options Array of optional parameters
|
* @param array $options Array of optional parameters
|
||||||
* 'user' a user instead of current
|
* 'user' a user instead of current
|
||||||
* 'content' notice content
|
* 'content' notice content
|
||||||
* 'inreplyto' ID of notice to reply to
|
* 'inreplyto' ID of notice to reply to
|
||||||
@ -96,8 +96,9 @@ class NoticeForm extends Form
|
|||||||
* 'lon' Longitude
|
* 'lon' Longitude
|
||||||
* 'location_id' ID of location
|
* 'location_id' ID of location
|
||||||
* 'location_ns' Namespace of location
|
* 'location_ns' Namespace of location
|
||||||
|
* @throws UserNoProfileException
|
||||||
*/
|
*/
|
||||||
function __construct($action, $options=null)
|
function __construct(Action $action, array $options = [])
|
||||||
{
|
{
|
||||||
parent::__construct($action);
|
parent::__construct($action);
|
||||||
|
|
||||||
@ -105,10 +106,6 @@ class NoticeForm extends Form
|
|||||||
// possibly existing HTML elements, as naming conventions are similar.
|
// possibly existing HTML elements, as naming conventions are similar.
|
||||||
$this->id_suffix = rand();
|
$this->id_suffix = rand();
|
||||||
|
|
||||||
if (is_null($options)) {
|
|
||||||
$options = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->actionName = $action->trimmed('action');
|
$this->actionName = $action->trimmed('action');
|
||||||
|
|
||||||
$prefill = array('content', 'inreplyto', 'lat',
|
$prefill = array('content', 'inreplyto', 'lat',
|
||||||
|
@ -1,57 +1,51 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||||
|
//
|
||||||
|
// GNU social is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// GNU social is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GNU Social
|
* Allows administrators to define additional profile fields for the users of a GNU social installation.
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
*
|
||||||
* @category Widget
|
* @category Widget
|
||||||
* @package GNU Social
|
* @package GNU social
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
* @author Max Shinn <trombonechamp@gmail.com>
|
||||||
* @copyright 2011 Free Software Foundation, Inc.
|
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
|
||||||
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
defined('GNUSOCIAL') || die();
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once $dir . '/lib/profiletools.php';
|
include_once __DIR__ . '/lib/profiletools.php';
|
||||||
|
|
||||||
class GNUsocialProfileExtensionsPlugin extends Plugin
|
class GNUsocialProfileExtensionsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
public function onCheckSchema(): bool
|
||||||
function onCheckSchema()
|
|
||||||
{
|
{
|
||||||
$schema = Schema::get();
|
$schema = Schema::get();
|
||||||
$schema->ensureTable('GNUsocialProfileExtensionField', GNUsocialProfileExtensionField::schemaDef());
|
$schema->ensureTable('gnusocialprofileextensionfield', GNUsocialProfileExtensionField::schemaDef());
|
||||||
$schema->ensureTable('GNUsocialProfileExtensionResponse', GNUsocialProfileExtensionResponse::schemaDef());
|
$schema->ensureTable('gnusocialprofileextensionresponse', GNUsocialProfileExtensionResponse::schemaDef());
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function onRouterInitialized($m)
|
|
||||||
{
|
|
||||||
$m->connect(':nickname/bio', ['action' => 'bio']);
|
|
||||||
$m->connect('admin/profilefields', ['action' => 'profilefieldsAdminPanel']);
|
|
||||||
$m->connect('notice/respond', ['action' => 'newresponse']);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndProfileFormData($action)
|
public function onRouterInitialized($m): bool
|
||||||
|
{
|
||||||
|
$m->connect('admin/profilefields', ['action' => 'profilefieldsAdminPanel']);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function onEndProfileFormData($action): bool
|
||||||
{
|
{
|
||||||
$fields = GNUsocialProfileExtensionField::allFields();
|
$fields = GNUsocialProfileExtensionField::allFields();
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -61,20 +55,26 @@ class GNUsocialProfileExtensionsPlugin extends Plugin
|
|||||||
$action->elementStart('li');
|
$action->elementStart('li');
|
||||||
$fieldname = $field->systemname;
|
$fieldname = $field->systemname;
|
||||||
if ($field->type == 'str') {
|
if ($field->type == 'str') {
|
||||||
$action->input($fieldname, $field->title,
|
$action->input(
|
||||||
($action->arg($fieldname)) ? $action->arg($fieldname) : $profile->$fieldname,
|
$fieldname,
|
||||||
$field->description);
|
$field->title,
|
||||||
}
|
($action->arg($fieldname)) ? $action->arg($fieldname) : $profile->$fieldname,
|
||||||
else if ($field->type == 'text') {
|
$field->description
|
||||||
$action->textarea($fieldname, $field->title,
|
);
|
||||||
($action->arg($fieldname)) ? $action->arg($fieldname) : $profile->$fieldname,
|
} elseif ($field->type == 'text') {
|
||||||
$field->description);
|
$action->textarea(
|
||||||
|
$fieldname,
|
||||||
|
$field->title,
|
||||||
|
($action->arg($fieldname)) ? $action->arg($fieldname) : $profile->$fieldname,
|
||||||
|
$field->description
|
||||||
|
);
|
||||||
}
|
}
|
||||||
$action->elementEnd('li');
|
$action->elementEnd('li');
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndProfileSaveForm($action)
|
public function onEndProfileSaveForm($action): bool
|
||||||
{
|
{
|
||||||
$fields = GNUsocialProfileExtensionField::allFields();
|
$fields = GNUsocialProfileExtensionField::allFields();
|
||||||
$user = common_current_user();
|
$user = common_current_user();
|
||||||
@ -90,33 +90,35 @@ class GNUsocialProfileExtensionsPlugin extends Plugin
|
|||||||
$response->fetch();
|
$response->fetch();
|
||||||
$response->value = $val;
|
$response->value = $val;
|
||||||
if ($response->validate()) {
|
if ($response->validate()) {
|
||||||
if (empty($val))
|
if (empty($val)) {
|
||||||
$response->delete();
|
$response->delete();
|
||||||
else
|
} else {
|
||||||
$response->update();
|
$response->update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$response->value = $val;
|
$response->value = $val;
|
||||||
$response->insert();
|
$response->insert();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndShowStyles($action)
|
public function onEndShowStyles($action): bool
|
||||||
{
|
{
|
||||||
$action->cssLink('/plugins/GNUsocialProfileExtensions/res/style.css');
|
$action->cssLink('/plugins/GNUsocialProfileExtensions/res/style.css');
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndShowScripts($action)
|
public function onEndShowScripts($action): bool
|
||||||
{
|
{
|
||||||
$action->script('plugins/GNUsocialProfileExtensions/js/profile.js');
|
$action->script('plugins/GNUsocialProfileExtensions/js/profile.js');
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEndAdminPanelNav($nav)
|
public function onEndAdminPanelNav($nav): bool
|
||||||
{
|
{
|
||||||
if (AdminPanelAction::canAdmin('profilefields')) {
|
if (AdminPanelAction::canAdmin('profilefields')) {
|
||||||
|
|
||||||
$action_name = $nav->action->trimmed('action');
|
$action_name = $nav->action->trimmed('action');
|
||||||
|
|
||||||
$nav->out->menuItem(
|
$nav->out->menuItem(
|
||||||
@ -130,11 +132,4 @@ class GNUsocialProfileExtensionsPlugin extends Plugin
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onStartPersonalGroupNav(Menu $nav, Profile $target, Profile $scoped=null)
|
|
||||||
{
|
|
||||||
$nav->out->menuItem(common_local_url('bio',
|
|
||||||
array('nickname' => $nav->action->trimmed('nickname'))), _('Bio'),
|
|
||||||
_('The user\'s extended profile'), $nav->action->trimmed('action') == 'bio', 'nav_bio');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
GNU Social Profile Extensions
|
GNU social Profile Extensions
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
Allows administrators to define additional profile fields for the
|
Allows administrators to define additional profile fields for the
|
||||||
users of a GNU Social installation.
|
users of a GNU social installation.
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
||||||
To install, copy this directory into your plugins directory and add
|
To enable, add the following lines to your config.php file:
|
||||||
the following lines to your config.php file:
|
|
||||||
|
|
||||||
addPlugin('GNUsocialProfileExtensions');
|
addPlugin('GNUsocialProfileExtensions');
|
||||||
$config['admin']['panels'][] = 'profilefields';
|
$config['admin']['panels'][] = 'profilefields';
|
@ -1,104 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* GNU Social
|
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* @category Widget
|
|
||||||
* @package GNU Social
|
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
|
||||||
* @copyright 2011 Free Software Foundation, Inc.
|
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once INSTALLDIR . '/lib/personalgroupnav.php';
|
|
||||||
require_once INSTALLDIR . '/classes/Profile.php';
|
|
||||||
require_once INSTALLDIR . '/lib/profilelist.php';
|
|
||||||
|
|
||||||
class BioAction extends Action
|
|
||||||
{
|
|
||||||
var $user = null;
|
|
||||||
|
|
||||||
function prepare(array $args = array())
|
|
||||||
{
|
|
||||||
parent::prepare($args);
|
|
||||||
|
|
||||||
$args = $this->returnToArgs();
|
|
||||||
$this->profile = Profile::getKV('nickname', $args[1]['nickname']);
|
|
||||||
//die(print_r($this->profile));
|
|
||||||
gnusocial_profile_merge($this->profile);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function handle()
|
|
||||||
{
|
|
||||||
parent::handle();
|
|
||||||
$this->showPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
function title()
|
|
||||||
{
|
|
||||||
return sprintf(_m("%s's Bio."), $this->profile->nickname);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showLocalNav()
|
|
||||||
{
|
|
||||||
$nav = new PersonalGroupNav($this);
|
|
||||||
$nav->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
function showContent()
|
|
||||||
{
|
|
||||||
if(empty($this->profile)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$profilelistitem = new ProfileListItem($this->profile, $this);
|
|
||||||
$profilelistitem->show();
|
|
||||||
$this->elementStart('ul');
|
|
||||||
$fields = GNUsocialProfileExtensionField::allFields();
|
|
||||||
foreach ($fields as $field) {
|
|
||||||
$fieldname = $field->systemname;
|
|
||||||
if (!empty($this->profile->$fieldname)) {
|
|
||||||
$this->elementStart('li', array('class' => 'biolistitem'));
|
|
||||||
$this->elementStart('div', array('class' => 'biolistitemcontainer'));
|
|
||||||
if ($field->type == 'text') {
|
|
||||||
$this->element('h3', array(), $field->title);
|
|
||||||
$this->element('p', array('class' => 'biovalue'), $this->profile->$fieldname);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->element('span', array('class' => 'biotitle'), $field->title);
|
|
||||||
$this->text(' ');
|
|
||||||
$this->element('span', array('class' => 'biovalue'), $this->profile->$fieldname);
|
|
||||||
}
|
|
||||||
$this->elementEnd('div');
|
|
||||||
$this->elementEnd('li');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->elementEnd('ul');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* GNU Social
|
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* @category Widget
|
|
||||||
* @package GNU Social
|
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
|
||||||
* @copyright 2011 Free Software Foundation, Inc.
|
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once INSTALLDIR . '/actions/newnotice.php';
|
|
||||||
|
|
||||||
class NewresponseAction extends NewnoticeAction
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Same as the parent, but not including the @-whoever in replies
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
|
|
||||||
function showNoticeForm()
|
|
||||||
{
|
|
||||||
$content = $this->trimmed('status_textarea');
|
|
||||||
if (!$content) {
|
|
||||||
$replyto = $this->trimmed('replyto');
|
|
||||||
$inreplyto = $this->trimmed('inreplyto');
|
|
||||||
} else {
|
|
||||||
// @fixme most of these bits above aren't being passed on above
|
|
||||||
$inreplyto = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$notice_form = new NoticeForm($this, '', $content, null, $inreplyto);
|
|
||||||
$notice_form->show();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,175 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* GNU Social
|
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* @category Widget
|
|
||||||
* @package GNU Social
|
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
|
||||||
* @copyright 2010 Free Software Foundation, Inc.
|
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once INSTALLDIR . '/lib/adminpanelaction.php';
|
|
||||||
|
|
||||||
class ProfilefieldsAdminPanelAction extends AdminPanelAction
|
|
||||||
{
|
|
||||||
|
|
||||||
function title()
|
|
||||||
{
|
|
||||||
return _('Profile fields');
|
|
||||||
}
|
|
||||||
|
|
||||||
function getInstructions()
|
|
||||||
{
|
|
||||||
return _('GNU Social custom profile fields');
|
|
||||||
}
|
|
||||||
|
|
||||||
function showForm()
|
|
||||||
{
|
|
||||||
$form = new ProfilefieldsAdminForm($this);
|
|
||||||
$form->show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSettings()
|
|
||||||
{
|
|
||||||
$field = GNUsocialProfileExtensionField::getKV('id', $this->trimmed('id'));
|
|
||||||
if (!$field)
|
|
||||||
$field = new GNUsocialProfileExtensionField();
|
|
||||||
$field->title = $this->trimmed('title');
|
|
||||||
$field->description = $this->trimmed('description');
|
|
||||||
$field->type = $this->trimmed('type');
|
|
||||||
$field->systemname = $this->trimmed('systemname');
|
|
||||||
if (!gnusocial_field_systemname_validate($field->systemname)) {
|
|
||||||
$this->clientError(_('Internal system name must be unique and consist of only alphanumeric characters!'));
|
|
||||||
}
|
|
||||||
if ($field->id) {
|
|
||||||
if ($field->validate())
|
|
||||||
$field->update();
|
|
||||||
else {
|
|
||||||
$this->clientError(_('There was an error with the field data.'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$field->insert();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProfilefieldsAdminForm extends AdminForm
|
|
||||||
{
|
|
||||||
|
|
||||||
function id()
|
|
||||||
{
|
|
||||||
return 'form_profilefields_admin_panel';
|
|
||||||
}
|
|
||||||
|
|
||||||
function formClass()
|
|
||||||
{
|
|
||||||
return 'form_settings';
|
|
||||||
}
|
|
||||||
|
|
||||||
function action()
|
|
||||||
{
|
|
||||||
return '/admin/profilefields';
|
|
||||||
}
|
|
||||||
|
|
||||||
function formData()
|
|
||||||
{
|
|
||||||
$title = null;
|
|
||||||
$description = null;
|
|
||||||
$type = null;
|
|
||||||
$systemname = null;
|
|
||||||
$id = null;
|
|
||||||
$fieldsettitle = _("New Profile Field");
|
|
||||||
//Edit a field
|
|
||||||
if ($this->out->trimmed('edit')) {
|
|
||||||
$field = GNUsocialProfileExtensionField::getKV('id', $this->out->trimmed('edit'));
|
|
||||||
$title = $field->title;
|
|
||||||
$description = $field->description;
|
|
||||||
$type = $field->type;
|
|
||||||
$systemname = $field->systemname;
|
|
||||||
$this->out->hidden('id', $field->id, 'id');
|
|
||||||
$fieldsettitle = _("Edit Profile Field");
|
|
||||||
}
|
|
||||||
//Don't show the list of all fields when editing one
|
|
||||||
else {
|
|
||||||
$this->out->elementStart('fieldset');
|
|
||||||
$this->out->element('legend', null, _('Existing Custom Profile Fields'));
|
|
||||||
$this->out->elementStart('ul', 'form_data');
|
|
||||||
$fields = GNUsocialProfileExtensionField::allFields();
|
|
||||||
foreach ($fields as $field) {
|
|
||||||
$this->li();
|
|
||||||
$content =
|
|
||||||
$this->out->elementStart('div');
|
|
||||||
$this->out->element('a', array('href' => '/admin/profilefields?edit=' . $field->id),
|
|
||||||
$field->title);
|
|
||||||
$this->out->text(' (' . $field->type . '): ' . $field->description);
|
|
||||||
$this->out->elementEnd('div');
|
|
||||||
$this->unli();
|
|
||||||
}
|
|
||||||
$this->out->elementEnd('ul');
|
|
||||||
$this->out->elementEnd('fieldset');
|
|
||||||
}
|
|
||||||
|
|
||||||
//New fields
|
|
||||||
$this->out->elementStart('fieldset');
|
|
||||||
$this->out->element('legend', null, $fieldsettitle);
|
|
||||||
$this->out->elementStart('ul', 'form_data');
|
|
||||||
|
|
||||||
$this->li();
|
|
||||||
$this->out->input('title', _('Title'), $title,
|
|
||||||
_('The title of the field'));
|
|
||||||
$this->unli();
|
|
||||||
$this->li();
|
|
||||||
$this->out->input('systemname', _('Internal name'), $systemname,
|
|
||||||
_('The alphanumeric name used internally for this field. Also the key used in OStatus user info. (optional)'));
|
|
||||||
$this->unli();
|
|
||||||
$this->li();
|
|
||||||
$this->out->input('description', _('Description'), $description,
|
|
||||||
_('An optional more detailed description of the field'));
|
|
||||||
$this->unli();
|
|
||||||
$this->li();
|
|
||||||
$this->out->dropdown('type', _('Type'), array('text' => _("Text"),
|
|
||||||
'str' => _("String")),
|
|
||||||
_('The type of the datafield'), false, $type);
|
|
||||||
$this->unli();
|
|
||||||
$this->out->elementEnd('ul');
|
|
||||||
$this->out->elementEnd('fieldset');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Action elements
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
|
|
||||||
function formActions()
|
|
||||||
{
|
|
||||||
$this->out->submit('submit', _('Save'), 'submit', null, _('Save new field'));
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,183 @@
|
|||||||
|
<?php
|
||||||
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||||
|
//
|
||||||
|
// GNU social is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// GNU social is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows administrators to define additional profile fields for the users of a GNU social installation.
|
||||||
|
*
|
||||||
|
* @category Widget
|
||||||
|
* @package GNU social
|
||||||
|
* @author Max Shinn <trombonechamp@gmail.com>
|
||||||
|
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||||
|
* @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
|
||||||
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||||
|
*/
|
||||||
|
|
||||||
|
defined('GNUSOCIAL') || die();
|
||||||
|
|
||||||
|
class ProfilefieldsAdminPanelAction extends AdminPanelAction
|
||||||
|
{
|
||||||
|
public function title(): string
|
||||||
|
{
|
||||||
|
return _m('Profile fields');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getInstructions(): string
|
||||||
|
{
|
||||||
|
return _m('GNU Social custom profile fields');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function showForm(): void
|
||||||
|
{
|
||||||
|
$form = new ProfilefieldsAdminForm($this);
|
||||||
|
$form->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveSettings(): void
|
||||||
|
{
|
||||||
|
$field = GNUsocialProfileExtensionField::getKV('id', $this->trimmed('id'));
|
||||||
|
if (!$field) {
|
||||||
|
$field = new GNUsocialProfileExtensionField();
|
||||||
|
$field->systemname = $this->trimmed('systemname');
|
||||||
|
if (!gnusocial_field_systemname_validate($field->systemname)) {
|
||||||
|
$this->clientError(_m('Internal system name must be unique and consist of only alphanumeric characters!'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$field->title = $this->trimmed('title');
|
||||||
|
$field->description = $this->trimmed('description');
|
||||||
|
$field->type = $this->trimmed('type');
|
||||||
|
if ($field->id) {
|
||||||
|
if ($field->validate()) {
|
||||||
|
$field->update();
|
||||||
|
} else {
|
||||||
|
$this->clientError(_m('There was an error with the field data.'));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$field->insert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ProfilefieldsAdminForm extends AdminForm
|
||||||
|
{
|
||||||
|
public function id(): string
|
||||||
|
{
|
||||||
|
return 'form_profilefields_admin_panel';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function formClass(): string
|
||||||
|
{
|
||||||
|
return 'form_settings';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function action(): string
|
||||||
|
{
|
||||||
|
return '/admin/profilefields';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function formData(): void
|
||||||
|
{
|
||||||
|
$title = null;
|
||||||
|
$description = null;
|
||||||
|
$type = null;
|
||||||
|
$systemname = null;
|
||||||
|
$id = null;
|
||||||
|
$fieldsettitle = _m("New Profile Field");
|
||||||
|
// Edit a field
|
||||||
|
if ($this->out->trimmed('edit')) {
|
||||||
|
$field = GNUsocialProfileExtensionField::getKV('id', $this->out->trimmed('edit'));
|
||||||
|
$title = $field->title;
|
||||||
|
$description = $field->description;
|
||||||
|
$type = $field->type;
|
||||||
|
$systemname = $field->systemname;
|
||||||
|
$this->out->hidden('id', $field->id, 'id');
|
||||||
|
$fieldsettitle = _m("Edit Profile Field");
|
||||||
|
} // Don't show the list of all fields when editing one
|
||||||
|
else {
|
||||||
|
$this->out->elementStart('fieldset');
|
||||||
|
$this->out->element('legend', null, _m('Existing Custom Profile Fields'));
|
||||||
|
$this->out->elementStart('ul', 'form_data');
|
||||||
|
$fields = GNUsocialProfileExtensionField::allFields();
|
||||||
|
foreach ($fields as $field) {
|
||||||
|
$this->li();
|
||||||
|
$this->out->elementStart('div');
|
||||||
|
$this->out->element(
|
||||||
|
'a',
|
||||||
|
array('href' => '/admin/profilefields?edit=' . $field->id),
|
||||||
|
$field->title
|
||||||
|
);
|
||||||
|
$this->out->text(' (' . $field->type . '): ' . $field->description);
|
||||||
|
$this->out->elementEnd('div');
|
||||||
|
$this->unli();
|
||||||
|
}
|
||||||
|
$this->out->elementEnd('ul');
|
||||||
|
$this->out->elementEnd('fieldset');
|
||||||
|
}
|
||||||
|
|
||||||
|
// New fields
|
||||||
|
$this->out->elementStart('fieldset');
|
||||||
|
$this->out->element('legend', null, $fieldsettitle);
|
||||||
|
$this->out->elementStart('ul', 'form_data');
|
||||||
|
|
||||||
|
$this->li();
|
||||||
|
$this->out->input(
|
||||||
|
'title',
|
||||||
|
_m('Title'),
|
||||||
|
$title,
|
||||||
|
_m('The title of the field')
|
||||||
|
);
|
||||||
|
$this->unli();
|
||||||
|
$this->li();
|
||||||
|
$this->out->input(
|
||||||
|
'systemname',
|
||||||
|
_m('Internal name'),
|
||||||
|
$systemname,
|
||||||
|
_m('The alphanumeric name used internally for this field. Also the key used in OStatus user info. (optional)')
|
||||||
|
);
|
||||||
|
$this->unli();
|
||||||
|
$this->li();
|
||||||
|
$this->out->input(
|
||||||
|
'description',
|
||||||
|
_m('Description'),
|
||||||
|
$description,
|
||||||
|
_m('An optional more detailed description of the field')
|
||||||
|
);
|
||||||
|
$this->unli();
|
||||||
|
$this->li();
|
||||||
|
$this->out->dropdown(
|
||||||
|
'type',
|
||||||
|
_m('Type'),
|
||||||
|
array('text' => _m("Text"),
|
||||||
|
'str' => _m("String")),
|
||||||
|
_m('The type of the datafield'),
|
||||||
|
false,
|
||||||
|
$type
|
||||||
|
);
|
||||||
|
$this->unli();
|
||||||
|
$this->out->elementEnd('ul');
|
||||||
|
$this->out->elementEnd('fieldset');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action elements
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function formActions(): void
|
||||||
|
{
|
||||||
|
$this->out->submit('submit', _m('Save'), 'submit', null, _m('Save new field'));
|
||||||
|
}
|
||||||
|
}
|
@ -1,36 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||||
|
//
|
||||||
|
// GNU social is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// GNU social is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GNU Social
|
* Allows administrators to define additional profile fields for the users of a GNU social installation.
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
*
|
||||||
* @category Widget
|
* @category Widget
|
||||||
* @package GNU Social
|
* @package GNU social
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
* @author Max Shinn <trombonechamp@gmail.com>
|
||||||
* @copyright 2010 Free Software Foundation, Inc.
|
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
|
||||||
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
defined('GNUSOCIAL') || die();
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
|
|
||||||
|
|
||||||
class GNUsocialProfileExtensionField extends Managed_DataObject
|
class GNUsocialProfileExtensionField extends Managed_DataObject
|
||||||
{
|
{
|
||||||
@ -40,53 +35,54 @@ class GNUsocialProfileExtensionField extends Managed_DataObject
|
|||||||
public $title; // varchar(191) not 255 because utf8mb4 takes more space
|
public $title; // varchar(191) not 255 because utf8mb4 takes more space
|
||||||
public $description; // text
|
public $description; // text
|
||||||
public $type; // varchar(191) not 255 because utf8mb4 takes more space
|
public $type; // varchar(191) not 255 because utf8mb4 takes more space
|
||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null default_0000-00-00%2000%3A00%3A00
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // datetime() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
public static function schemaDef()
|
public static function schemaDef(): array
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
'fields' => array(
|
'fields' => [
|
||||||
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension field'),
|
'id' => ['type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension field'],
|
||||||
'systemname' => array('type' => 'varchar', 'not null' => true, 'length' => 64, 'description' => 'field systemname'),
|
'systemname' => ['type' => 'varchar', 'not null' => true, 'length' => 64, 'description' => 'field systemname'],
|
||||||
'title' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'field title'),
|
'title' => ['type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'field title'],
|
||||||
'description' => array('type' => 'text', 'not null' => true, 'description' => 'field description'),
|
'description' => ['type' => 'text', 'not null' => true, 'description' => 'field description'],
|
||||||
'type' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'field type'),
|
'type' => ['type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'field type'],
|
||||||
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
|
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
|
||||||
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
'modified' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
||||||
),
|
],
|
||||||
'primary key' => array('id'),
|
'primary key' => ['id'],
|
||||||
'indexes' => array(
|
'indexes' => [
|
||||||
'gnusocialprofileextensionfield_title_idx' => array('title'),
|
'gnusocialprofileextensionfield_title_idx' => ['title'],
|
||||||
),
|
],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
static function newField($title, $description=null, $type='str', $systemname=null)
|
public static function newField($title, $description = null, $type = 'str', $system_name = null): GNUsocialProfileExtensionField
|
||||||
{
|
{
|
||||||
$field = new GNUsocialProfileExtensionField();
|
$field = new GNUsocialProfileExtensionField();
|
||||||
$field->title = $title;
|
$field->title = $title;
|
||||||
$field->description = $description;
|
$field->description = $description;
|
||||||
$field->type = $type;
|
$field->type = $type;
|
||||||
if (empty($systemname))
|
if (empty($system_name)) {
|
||||||
$field->systemname = 'field' + $field->id;
|
$field->systemname = 'field' . $field->id;
|
||||||
else
|
} else {
|
||||||
$field->systemname = $systemname;
|
$field->systemname = $system_name;
|
||||||
|
}
|
||||||
|
|
||||||
$field->id = $field->insert();
|
$field->id = $field->insert();
|
||||||
if (!$field->id){
|
if (!$field->id) {
|
||||||
common_log_db_error($field, 'INSERT', __FILE__);
|
common_log_db_error($field, 'INSERT', __FILE__);
|
||||||
throw new ServerException(_m('Error creating new field.'));
|
throw new ServerException(_m('Error creating new field.'));
|
||||||
}
|
}
|
||||||
return $field;
|
return $field;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function allFields()
|
public static function allFields(): array
|
||||||
{
|
{
|
||||||
$field = new GNUsocialProfileExtensionField();
|
$field = new GNUsocialProfileExtensionField();
|
||||||
$fields = array();
|
$fields = [];
|
||||||
if ($field->find()) {
|
if ($field->find()) {
|
||||||
while($field->fetch()) {
|
while ($field->fetch()) {
|
||||||
$fields[] = clone($field);
|
$fields[] = clone($field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||||
|
//
|
||||||
|
// GNU social is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// GNU social is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GNU Social
|
* Allows administrators to define additional profile fields for the users of a GNU social installation.
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
*
|
||||||
* @category Widget
|
* @category Widget
|
||||||
* @package GNU Social
|
* @package GNU social
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
* @author Max Shinn <trombonechamp@gmail.com>
|
||||||
* @copyright 2010 Free Software Foundation, Inc.
|
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
|
||||||
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('STATUSNET')) {
|
defined('GNUSOCIAL') || die();
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
|
|
||||||
|
|
||||||
class GNUsocialProfileExtensionResponse extends Managed_DataObject
|
class GNUsocialProfileExtensionResponse extends Managed_DataObject
|
||||||
{
|
{
|
||||||
@ -38,56 +33,56 @@ class GNUsocialProfileExtensionResponse extends Managed_DataObject
|
|||||||
public $id; // int(11)
|
public $id; // int(11)
|
||||||
public $extension_id; // int(11)
|
public $extension_id; // int(11)
|
||||||
public $profile_id; // int(11)
|
public $profile_id; // int(11)
|
||||||
public $value; // text
|
public $value; // text
|
||||||
public $created; // datetime() not_null
|
public $created; // datetime() not_null default_0000-00-00%2000%3A00%3A00
|
||||||
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
public $modified; // datetime() not_null default_CURRENT_TIMESTAMP
|
||||||
|
|
||||||
public static function schemaDef()
|
public static function schemaDef(): array
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
'fields' => array(
|
'fields' => [
|
||||||
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension response'),
|
'id' => ['type' => 'serial', 'not null' => true, 'description' => 'Unique ID for extension response'],
|
||||||
'extension_id' => array('type' => 'int', 'not null' => true, 'description' => 'The extension field ID'),
|
'extension_id' => ['type' => 'int', 'not null' => true, 'description' => 'The extension field ID'],
|
||||||
'profile_id' => array('type' => 'int', 'not null' => true, 'description' => 'Profile id that made the response'),
|
'profile_id' => ['type' => 'int', 'not null' => true, 'description' => 'Profile id that made the response'],
|
||||||
'value' => array('type' => 'text', 'not null' => true, 'description' => 'response entry'),
|
'value' => ['type' => 'text', 'not null' => true, 'description' => 'response entry'],
|
||||||
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
|
'created' => ['type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'],
|
||||||
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
'modified' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
|
||||||
),
|
],
|
||||||
'primary key' => array('id'),
|
'primary key' => ['id'],
|
||||||
'foreign keys' => array(
|
// Syntax: foreign_key_name => [remote_table, local_key => remote_key]]
|
||||||
'gnusocialprofileextensionresponse_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
|
'foreign keys' => [
|
||||||
'gnusocialprofileextensionresponse_extension_id_fkey' => array('gnusocialprofileextensionfield', array('extension_id' => 'id')),
|
'gnusocialprofileextensionresponse_profile_id_fkey' => ['profile', ['profile_id' => 'id']],
|
||||||
),
|
'gnusocialprofileextensionresponse_extension_id_fkey' => ['gnusocialprofileextensionfield', ['extension_id' => 'id']],
|
||||||
'indexes' => array(
|
],
|
||||||
'gnusocialprofileextensionresponse_extension_id_idx' => array('extension_id'),
|
'indexes' => [
|
||||||
),
|
'gnusocialprofileextensionresponse_extension_id_idx' => ['extension_id'],
|
||||||
);
|
],
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
static function newResponse($extension_id, $profile_id, $value)
|
public static function newResponse($extension_id, $profile_id, $value): GNUsocialProfileExtensionResponse
|
||||||
{
|
{
|
||||||
|
|
||||||
$response = new GNUsocialProfileExtensionResponse();
|
$response = new GNUsocialProfileExtensionResponse();
|
||||||
$response->extension_id = $extension_id;
|
$response->extension_id = $extension_id;
|
||||||
$response->profile_id = $profile_id;
|
$response->profile_id = $profile_id;
|
||||||
$response->value = $value;
|
$response->value = $value;
|
||||||
|
|
||||||
$response->id = $response->insert();
|
$response->id = $response->insert();
|
||||||
if (!$response->id){
|
if (!$response->id) {
|
||||||
common_log_db_error($response, 'INSERT', __FILE__);
|
common_log_db_error($response, 'INSERT', __FILE__);
|
||||||
throw new ServerException(_m('Error creating new response.'));
|
throw new ServerException(_m('Error creating new response.'));
|
||||||
}
|
}
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function findResponsesByProfile($id)
|
public static function findResponsesByProfile($id): array
|
||||||
{
|
{
|
||||||
$extf = 'gnusocialprofileextensionfield';
|
$extf = 'gnusocialprofileextensionfield';
|
||||||
$extr = 'gnusocialprofileextensionresponse';
|
$extr = 'gnusocialprofileextensionresponse';
|
||||||
$sql = "SELECT $extr.*, $extf.title, $extf.description, $extf.type, $extf.systemname FROM $extr JOIN $extf ON $extr.extension_id=$extf.id WHERE $extr.profile_id = $id";
|
$sql = "SELECT $extr.*, $extf.title, $extf.description, $extf.type, $extf.systemname FROM $extr JOIN $extf ON $extr.extension_id=$extf.id WHERE $extr.profile_id = $id";
|
||||||
$response = new GNUsocialProfileExtensionResponse();
|
$response = new GNUsocialProfileExtensionResponse();
|
||||||
$response->query($sql);
|
$response->query($sql);
|
||||||
$responses = array();
|
$responses = [];
|
||||||
|
|
||||||
while ($response->fetch()) {
|
while ($response->fetch()) {
|
||||||
$responses[] = clone($response);
|
$responses[] = clone($response);
|
||||||
@ -95,5 +90,4 @@ class GNUsocialProfileExtensionResponse extends Managed_DataObject
|
|||||||
|
|
||||||
return $responses;
|
return $responses;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,223 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* GNU Social
|
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* @category Widget
|
|
||||||
* @package GNU Social
|
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
|
||||||
* @copyright 2011 Free Software Foundation, Inc.
|
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
|
||||||
*/
|
|
||||||
//functions to sort replies
|
|
||||||
class NoticeTree extends NoticeList
|
|
||||||
{
|
|
||||||
function show()
|
|
||||||
{
|
|
||||||
$this->out->elementStart('div', array('id' =>'notices_primary'));
|
|
||||||
// TRANS: Header on conversation page. Hidden by default (h2).
|
|
||||||
$this->out->element('h2', null, _('Notices'));
|
|
||||||
$this->out->elementStart('ol', array('class' => 'notices xoxo'));
|
|
||||||
|
|
||||||
$cnt = 0;
|
|
||||||
|
|
||||||
while ($this->notice->fetch() && $cnt <= NOTICES_PER_PAGE) {
|
|
||||||
if (!empty($this->notice->reply_to))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$cnt++;
|
|
||||||
|
|
||||||
if ($cnt > NOTICES_PER_PAGE) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$this->showNoticePlus($this->newListItem($this->notice));
|
|
||||||
} catch (Exception $e) {
|
|
||||||
// we log exceptions and continue
|
|
||||||
print "ERROR!" . $e->getMessage();
|
|
||||||
common_log(LOG_ERR, $e->getMessage());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->out->elementEnd('ol');
|
|
||||||
$this->out->elementEnd('div');
|
|
||||||
|
|
||||||
return $cnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
function _cmpDate($a, $b) { return strcmp($a->notice->modified, $b->notice->modified); }
|
|
||||||
function _cmpFav($a, $b) { return (int)$a->faves < (int)$b->faves; }
|
|
||||||
|
|
||||||
function showNoticePlus($item)
|
|
||||||
{
|
|
||||||
$replies = new Notice();
|
|
||||||
$replies->reply_to = $item->notice->id;
|
|
||||||
|
|
||||||
// We take responsibility for doing the li
|
|
||||||
|
|
||||||
$this->out->elementStart('li', array('class' => 'h-entry notice',
|
|
||||||
'id' => 'notice-' . $item->notice->id));
|
|
||||||
|
|
||||||
$item->show();
|
|
||||||
|
|
||||||
if ($replies->find()) {
|
|
||||||
$this->out->elementStart('ol', array('class' => 'notices'));
|
|
||||||
|
|
||||||
$replieslist = array();
|
|
||||||
while ($replies->fetch()) {
|
|
||||||
$replieslist[] = $this->newListItem(clone($replies));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Sorting based on url argument
|
|
||||||
if($_GET['sort'] == 'faves')
|
|
||||||
usort($replieslist, array($this, '_cmpFav'));
|
|
||||||
else
|
|
||||||
usort($replieslist, array($this, '_cmpDate'));
|
|
||||||
|
|
||||||
|
|
||||||
foreach($replieslist as $reply) {
|
|
||||||
$this->showNoticePlus($reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->out->elementEnd('ol');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->out->elementEnd('li');
|
|
||||||
}
|
|
||||||
|
|
||||||
function newListItem($notice)
|
|
||||||
{
|
|
||||||
return new NoticeTreeItem($notice, $this->out);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class NoticeTreeItem extends NoticeListItem
|
|
||||||
{
|
|
||||||
function __construct($notice, $out=null)
|
|
||||||
{
|
|
||||||
parent::__construct($notice, $out);
|
|
||||||
//TODO: Rewrite this
|
|
||||||
//Showing number of favorites
|
|
||||||
$fave = new Fave();
|
|
||||||
$fave->notice_id = $this->notice->id;
|
|
||||||
$cnt = 0;
|
|
||||||
if ($fave->find()) {
|
|
||||||
while ($fave->fetch())
|
|
||||||
$cnt++;
|
|
||||||
}
|
|
||||||
$this->faves = $cnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showStart()
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showEnd()
|
|
||||||
{
|
|
||||||
if ($this->faves > 0) {
|
|
||||||
$this->out->text(_m("Favorited by $this->faves user"));
|
|
||||||
if ($this->faves > 1) $this->out->text("s"); //there has to be a better way to do this...
|
|
||||||
}
|
|
||||||
|
|
||||||
//Show response form
|
|
||||||
$this->out->elementStart('div', array('id' => 'form' . $this->notice->id, 'class' => 'replyform'));
|
|
||||||
$noticeform = new ReplyForm($this->out, null, null, null, $this->notice->id);
|
|
||||||
$noticeform->show();
|
|
||||||
$this->out->elementEnd('div');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Just changing the link...
|
|
||||||
function showReplyLink()
|
|
||||||
{
|
|
||||||
if (common_logged_in()) {
|
|
||||||
$this->out->text(' ');
|
|
||||||
//Why doesn't common_local_url work here?
|
|
||||||
$reply_url = '/notice/respond?replyto=' . $this->profile->nickname . '&inreplyto=' . $this->notice->id;
|
|
||||||
$this->out->elementStart('a', array('href' => $reply_url,
|
|
||||||
'class' => 'notice_reply',
|
|
||||||
'title' => _('Reply to this notice')));
|
|
||||||
$this->out->text(_('Reply'));
|
|
||||||
$this->out->text(' ');
|
|
||||||
$this->out->element('span', 'notice_id', $this->notice->id);
|
|
||||||
$this->out->elementEnd('a');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
class ReplyForm extends NoticeForm
|
|
||||||
{
|
|
||||||
//Changing the text. We have to either repeat ids or get hacky. I vote repeat ids.
|
|
||||||
function formData()
|
|
||||||
{
|
|
||||||
if (Event::handle('StartShowNoticeFormData', array($this))) {
|
|
||||||
// XXX: vary by defined max size
|
|
||||||
$this->out->element('textarea', array('id' => 'notice_data-text',
|
|
||||||
'cols' => 35,
|
|
||||||
'rows' => 4,
|
|
||||||
'name' => 'status_textarea'),
|
|
||||||
($this->content) ? $this->content : '');
|
|
||||||
|
|
||||||
$contentLimit = Notice::maxContent();
|
|
||||||
|
|
||||||
if ($contentLimit > 0) {
|
|
||||||
$this->out->elementStart('dl', 'form_note');
|
|
||||||
$this->out->element('dt', null, _('Available characters'));
|
|
||||||
$this->out->element('dd', array('id' => 'notice_text-count'),
|
|
||||||
$contentLimit);
|
|
||||||
$this->out->elementEnd('dl');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (common_config('attachments', 'uploads')) {
|
|
||||||
$this->out->element('label', array('for' => 'notice_data-attach'),_('Attach'));
|
|
||||||
$this->out->element('input', array('id' => 'notice_data-attach',
|
|
||||||
'type' => 'file',
|
|
||||||
'name' => 'attach',
|
|
||||||
'title' => _('Attach a file')));
|
|
||||||
$this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota'));
|
|
||||||
}
|
|
||||||
if ($this->action) {
|
|
||||||
$this->out->hidden('notice_return-to', $this->action, 'returnto');
|
|
||||||
}
|
|
||||||
$this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto');
|
|
||||||
|
|
||||||
if ($this->profile->shareLocation()) {
|
|
||||||
$this->out->hidden('notice_data-lat', empty($this->lat) ? (empty($this->profile->lat) ? null : $this->profile->lat) : $this->lat, 'lat');
|
|
||||||
$this->out->hidden('notice_data-lon', empty($this->lon) ? (empty($this->profile->lon) ? null : $this->profile->lon) : $this->lon, 'lon');
|
|
||||||
$this->out->hidden('notice_data-location_id', empty($this->location_id) ? (empty($this->profile->location_id) ? null : $this->profile->location_id) : $this->location_id, 'location_id');
|
|
||||||
$this->out->hidden('notice_data-location_ns', empty($this->location_ns) ? (empty($this->profile->location_ns) ? null : $this->profile->location_ns) : $this->location_ns, 'location_ns');
|
|
||||||
|
|
||||||
$this->out->elementStart('div', array('id' => 'notice_data-geo_wrap',
|
|
||||||
'title' => common_local_url('geocode')));
|
|
||||||
$this->out->checkbox('notice_data-geo', _('Share my location'), true);
|
|
||||||
$this->out->elementEnd('div');
|
|
||||||
$this->out->inlineScript(' var NoticeDataGeo_text = {'.
|
|
||||||
'ShareDisable: ' .json_encode(_('Do not share my location')).','.
|
|
||||||
'ErrorTimeout: ' .json_encode(_('Sorry, retrieving your geo location is taking longer than expected, please try again later')).
|
|
||||||
'}');
|
|
||||||
}
|
|
||||||
|
|
||||||
Event::handle('EndShowNoticeFormData', array($this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,35 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
||||||
|
//
|
||||||
|
// GNU social is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// GNU social is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GNU Social
|
* Allows administrators to define additional profile fields for the users of a GNU social installation.
|
||||||
* Copyright (C) 2010, Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* PHP version 5
|
|
||||||
*
|
|
||||||
* LICENCE:
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
*
|
||||||
* @category Widget
|
* @category Widget
|
||||||
* @package GNU Social
|
* @package GNU social
|
||||||
* @author Max Shinn <trombonechamp@gmail.com>
|
* @author Max Shinn <trombonechamp@gmail.com>
|
||||||
* @copyright 2010 Free Software Foundation, Inc.
|
* @author Diogo Cordeiro <diogo@fc.up.pt>
|
||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @copyright 2011-2019 Free Software Foundation, Inc http://www.fsf.org
|
||||||
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
defined('GNUSOCIAL') || die();
|
||||||
|
|
||||||
function gnusocial_profile_merge(&$profile)
|
function gnusocial_profile_merge(&$profile)
|
||||||
{
|
{
|
||||||
$responses = GNUsocialProfileExtensionResponse::findResponsesByProfile($profile->id);
|
$responses = GNUsocialProfileExtensionResponse::findResponsesByProfile($profile->id);
|
||||||
$profile->customfields = array();
|
$profile->customfields = [];
|
||||||
foreach ($responses as $response) {
|
foreach ($responses as $response) {
|
||||||
$title = $response->systemname;
|
$title = $response->systemname;
|
||||||
$profile->$title = $response->value;
|
$profile->$title = $response->value;
|
||||||
@ -39,9 +40,13 @@ function gnusocial_profile_merge(&$profile)
|
|||||||
|
|
||||||
function gnusocial_field_systemname_validate($systemname)
|
function gnusocial_field_systemname_validate($systemname)
|
||||||
{
|
{
|
||||||
|
// Ensure it doesn't exist already
|
||||||
$fields = GNUsocialProfileExtensionField::allFields();
|
$fields = GNUsocialProfileExtensionField::allFields();
|
||||||
foreach ($fields as $field)
|
foreach ($fields as $field) {
|
||||||
if ($field->systemname == $systemname)
|
if ($field->systemname == $systemname) {
|
||||||
return false;
|
return false;
|
||||||
return ctype_alphanum($systemname);
|
}
|
||||||
|
}
|
||||||
|
// Ensure that it consist of only alphanumeric characters
|
||||||
|
return ctype_alnum($systemname);
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2019-08-14 14:51+0100\n"
|
"POT-Creation-Date: 2019-08-14 14:54+0100\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@ -25,15 +25,90 @@ msgstr ""
|
|||||||
msgid "Custom profile fields"
|
msgid "Custom profile fields"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: actions/bio.php:62
|
#: actions/profilefieldsadminpanel.php:34
|
||||||
#, php-format
|
msgid "Profile fields"
|
||||||
msgid "%s's Bio."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: classes/GNUsocialProfileExtensionField.php:79
|
#: actions/profilefieldsadminpanel.php:39
|
||||||
|
msgid "GNU Social custom profile fields"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:55
|
||||||
|
msgid ""
|
||||||
|
"Internal system name must be unique and consist of only alphanumeric "
|
||||||
|
"characters!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:65
|
||||||
|
msgid "There was an error with the field data."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:97
|
||||||
|
msgid "New Profile Field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:106
|
||||||
|
msgid "Edit Profile Field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:110
|
||||||
|
msgid "Existing Custom Profile Fields"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:137
|
||||||
|
msgid "Title"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:139
|
||||||
|
msgid "The title of the field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:145
|
||||||
|
msgid "Internal name"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:147
|
||||||
|
msgid ""
|
||||||
|
"The alphanumeric name used internally for this field. Also the key used in "
|
||||||
|
"OStatus user info. (optional)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:153
|
||||||
|
msgid "Description"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:155
|
||||||
|
msgid "An optional more detailed description of the field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:161
|
||||||
|
msgid "Type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:162
|
||||||
|
msgid "Text"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:163
|
||||||
|
msgid "String"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:164
|
||||||
|
msgid "The type of the datafield"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:181
|
||||||
|
msgid "Save"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: actions/profilefieldsadminpanel.php:181
|
||||||
|
msgid "Save new field"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: classes/GNUsocialProfileExtensionField.php:75
|
||||||
msgid "Error creating new field."
|
msgid "Error creating new field."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: classes/GNUsocialProfileExtensionResponse.php:78
|
#: classes/GNUsocialProfileExtensionResponse.php:73
|
||||||
msgid "Error creating new response."
|
msgid "Error creating new response."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
Loading…
Reference in New Issue
Block a user