1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

camelCase variables

This commit is contained in:
Thomas Tanghus 2014-03-18 00:58:01 +01:00
parent 300834d861
commit 868bf088b3
8 changed files with 32 additions and 32 deletions

View File

@ -103,7 +103,7 @@ class AddressbookProvider implements \OCP\IAddressBook {
break;
}
if(in_array($row['name'], Properties::$multi_properties)) {
if(in_array($row['name'], Properties::$multiProperties)) {
if(!isset($results[$row['contactid']])) {
$results[$row['contactid']] = array('id' => $row['contactid'], $row['name'] => array($value));
} elseif(!isset($results[$row['contactid']][$row['name']])) {

View File

@ -590,7 +590,7 @@ class Contact extends VObject\VCard implements IPIMObject {
*
* NOTE: The data has actually already been merged client side!
* NOTE: The only properties coming from the web client are the ones
* defined in \OCA\Contacts\Utils\Properties::$index_properties and
* defined in \OCA\Contacts\Utils\Properties::$indexProperties and
* UID is skipped for obvious reasons, and PHOTO is currently not updated.
* The data array has this structure:
*
@ -608,12 +608,12 @@ class Contact extends VObject\VCard implements IPIMObject {
if(!is_array($properties)) {
\OCP\Util::writeLog('contacts', __METHOD__.' not an array?: ' .$name. ' '.print_r($properties, true), \OCP\Util::DEBUG);
}
if(in_array($name, Utils\Properties::$multi_properties)) {
if(in_array($name, Utils\Properties::$multiProperties)) {
unset($this->{$name});
}
foreach($properties as $parray) {
\OCP\Util::writeLog('contacts', __METHOD__.' adding: ' .$name. ' '.print_r($parray['value'], true) . ' ' . print_r($parray['parameters'], true), \OCP\Util::DEBUG);
if(in_array($name, Utils\Properties::$multi_properties)) {
if(in_array($name, Utils\Properties::$multiProperties)) {
// TODO: wrap in try/catch, check return value
$this->setPropertyByChecksum('new', $name, $parray['value'], $parray['parameters']);
} else {
@ -643,7 +643,7 @@ class Contact extends VObject\VCard implements IPIMObject {
continue;
}
\OCP\Util::writeLog('contacts', __METHOD__.' merging: ' .$property->name, \OCP\Util::DEBUG);
if(in_array($property->name, Utils\Properties::$multi_properties)) {
if(in_array($property->name, Utils\Properties::$multiProperties)) {
$ownproperties = $this->select($property->name);
if(count($ownproperties) === 0) {
// We don't have any instances of this property, so just add it.

View File

@ -103,7 +103,7 @@ class ContactController extends Controller {
->bailOut(App::$l10n->t('Property name is not set.'));
}
if (!$checksum && in_array($name, Properties::$multi_properties)) {
if (!$checksum && in_array($name, Properties::$multiProperties)) {
return $response
->setStatus(Http::STATUS_PRECONDITION_FAILED)
->bailOut(App::$l10n->t('Property checksum is not set.'));
@ -117,7 +117,7 @@ class ContactController extends Controller {
$result = array('contactId' => $params['contactId']);
if ($checksum && in_array($name, Properties::$multi_properties)) {
if ($checksum && in_array($name, Properties::$multiProperties)) {
try {
if(is_null($value)) {
$contact->unsetPropertyByChecksum($checksum);
@ -130,7 +130,7 @@ class ContactController extends Controller {
->setStatus(Http::STATUS_PRECONDITION_FAILED)
->bailOut(App::$l10n->t('Information about vCard is incorrect. Please reload the page.'));
}
} elseif (!in_array($name, Properties::$multi_properties)) {
} elseif (!in_array($name, Properties::$multiProperties)) {
if (is_null($value)) {
unset($contact->{$name});

View File

@ -28,14 +28,14 @@ class PageController extends Controller {
public function index() {
\OC::$server->getNavigationManager()->setActiveEntry('contacts');
$impp_types = Properties::getTypesForProperty('IMPP');
$adr_types = Properties::getTypesForProperty('ADR');
$phone_types = Properties::getTypesForProperty('TEL');
$email_types = Properties::getTypesForProperty('EMAIL');
$imppTypes = Properties::getTypesForProperty('IMPP');
$adrTypes = Properties::getTypesForProperty('ADR');
$phoneTypes = Properties::getTypesForProperty('TEL');
$emailTypes = Properties::getTypesForProperty('EMAIL');
$ims = Properties::getIMOptions();
$im_protocols = array();
$imProtocols = array();
foreach($ims as $name => $values) {
$im_protocols[$name] = $values['displayname'];
$imProtocols[$name] = $values['displayname'];
}
$maxUploadFilesize = \OCP\Util::maxUploadFilesize('/');
@ -62,11 +62,11 @@ class PageController extends Controller {
$response->setParams(array(
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'phone_types' => $phone_types,
'email_types' => $email_types,
'adr_types' => $adr_types,
'impp_types' => $impp_types,
'im_protocols' => $im_protocols,
'phoneTypes' => $phoneTypes,
'emailTypes' => $emailTypes,
'adrTypes' => $adrTypes,
'imppTypes' => $imppTypes,
'imProtocols' => $imProtocols,
));
return $response;

View File

@ -209,13 +209,13 @@ class Hooks{
$app = new App();
$addressBooks = $app->getAddressBooksForUser();
$base_url = \OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id=';
$baseUrl = \OCP\Util::linkTo('calendar', 'ajax/events.php').'?calendar_id=';
foreach ($addressBooks as $addressBook) {
$info = $addressBook->getMetaData();
$parameters['sources'][]
= array(
'url' => $base_url.'birthday_'. $info['backend'].'_'.$info['id'],
'url' => $baseUrl . 'birthday_'. $info['backend'].'_' . $info['id'],
'backgroundColor' => '#cccccc',
'borderColor' => '#888',
'textColor' => 'black',

View File

@ -139,7 +139,7 @@ class JSONSerializer {
* but we should look out for any problems.
*/
public static function serializeProperty(\Sabre\VObject\Property $property) {
if(!in_array($property->name, Properties::$index_properties)) {
if(!in_array($property->name, Properties::$indexProperties)) {
return;
}
$value = $property->value;
@ -188,7 +188,7 @@ class JSONSerializer {
);
// This cuts around a 3rd off of the json response size.
if(in_array($property->name, Properties::$multi_properties)) {
if(in_array($property->name, Properties::$multiProperties)) {
$temp['checksum'] = substr(md5($property->serialize()), 0, 8);
}
foreach($property->parameters as $parameter) {

View File

@ -48,14 +48,14 @@ Class Properties {
*
* @var array
*/
public static $multi_properties = array('EMAIL', 'TEL', 'IMPP', 'ADR', 'URL');
public static $multiProperties = array('EMAIL', 'TEL', 'IMPP', 'ADR', 'URL');
/**
* Properties to index.
*
* @var array
*/
public static $index_properties = array(
public static $indexProperties = array(
'BDAY', 'UID', 'N', 'FN', 'TITLE', 'ROLE', 'NOTE', 'NICKNAME',
'ORG', 'CATEGORIES', 'EMAIL', 'TEL', 'IMPP', 'ADR', 'URL', 'GEO');
@ -256,7 +256,7 @@ Class Properties {
. '(`userid`, `contactid`,`name`,`value`,`preferred`) VALUES(?,?,?,?,?)' );
}
foreach($vcard->children as $property) {
if(!in_array($property->name, self::$index_properties)) {
if(!in_array($property->name, self::$indexProperties)) {
continue;
}
$preferred = 0;

View File

@ -377,7 +377,7 @@
<span class="parameters">
<input type="checkbox" class="parameter tooltipped rightwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="rtl type parameter" data-parameter="TYPE" name="parameters[TYPE][]">
<?php print_unescaped(OCP\html_select_options($_['email_types'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['emailTypes'], array())) ?>
</select>
</span>
<input type="email" class="nonempty value" name="value" value="{value}" x-moz-errormessage="<?php p($l->t('Please specify a valid email address.')); ?>" placeholder="<?php p($l->t('someone@example.com')); ?>" required />
@ -392,7 +392,7 @@
<span class="parameters">
<input type="checkbox" class="parameter tooltipped rightwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="rtl type parameter" data-parameter="TYPE" name="parameters[TYPE][]">
<?php print_unescaped(OCP\html_select_options($_['phone_types'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['phoneTypes'], array())) ?>
</select>
</span>
<input type="text" class="nonempty value" name="value" value="{value}" placeholder="<?php p($l->t('Enter phone number')); ?>" required />
@ -406,7 +406,7 @@
<span class="parameters">
<input type="checkbox" class="parameter tooltipped rightwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="rtl type parameter" data-parameter="TYPE" name="parameters[TYPE][]">
<?php print_unescaped(OCP\html_select_options($_['email_types'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['emailTypes'], array())) ?>
</select>
</span>
<input type="url" class="nonempty value" name="value" value="{value}" placeholder="http://www.example.com/" required />
@ -421,7 +421,7 @@
<span class="parameters">
<input type="checkbox" id="adr_pref_{idx}" class="parameter tooltipped downwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="type parameter" data-parameter="TYPE" name="parameters[TYPE][]">
<?php print_unescaped(OCP\html_select_options($_['impp_types'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['adrTypes'], array())) ?>
</select>
</span>
<span class="float display">
@ -463,7 +463,7 @@
<span class="parameters">
<input type="checkbox" id="adr_pref_{idx}" class="parameter tooltipped downwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="type parameter" data-parameter="TYPE" name="parameters[TYPE][]">
<?php print_unescaped(OCP\html_select_options($_['impp_types'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['imppTypes'], array())) ?>
</select>
</span>
-->
@ -473,7 +473,7 @@
<span class="parameters">
<input type="checkbox" id="impp_pref_{idx}" class="parameter tooltipped downwards" data-parameter="TYPE" name="parameters[TYPE][]" value="PREF" title="<?php p($l->t('Preferred')); ?>" />
<select class="rtl type parameter" data-parameter="X-SERVICE-TYPE" name="parameters[X-SERVICE-TYPE]">
<?php print_unescaped(OCP\html_select_options($_['im_protocols'], array())) ?>
<?php print_unescaped(OCP\html_select_options($_['imProtocols'], array())) ?>
</select>
</span>
<input type="text" class="nonempty value" name="value" value="{value}"