Skip to content

Commit

Permalink
getMIMEPart() -> getMimePart()
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 19, 2014
1 parent 6e1e050 commit 7416946
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion imp/lib/Ajax/Imple/ImportEncryptKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function _handle(Horde_Variables $vars)
/* Retrieve the key from the message. */
try {
$contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices_Mailbox($vars));
if (!($mime_part = $contents->getMIMEPart($vars->mime_id))) {
if (!($mime_part = $contents->getMimePart($vars->mime_id))) {
throw new IMP_Exception(
_("Cannot retrieve public key from message.")
);
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Ajax/Imple/ItipRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function _handle(Horde_Variables $vars)
/* Retrieve the calendar data from the message. */
try {
$contents = $injector->getInstance('IMP_Factory_Contents')->create(new IMP_Indices_Mailbox($vars));
if (!($mime_part = $contents->getMIMEPart($vars->mime_id))) {
if (!($mime_part = $contents->getMimePart($vars->mime_id))) {
throw new IMP_Exception(
_("Cannot retrieve calendar data from message.")
);
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Ajax/Imple/VcardImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function _handle(Horde_Variables $vars)
try {
$contents = $injector->getInstance('IMP_Factory_Contents')
->create(new IMP_Indices_Mailbox($vars));
if (!($mime_part = $contents->getMIMEPart($vars->mime_id))) {
if (!($mime_part = $contents->getMimePart($vars->mime_id))) {
throw new IMP_Exception(
_("Cannot retrieve vCard data from message.")
);
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Basic/Saveimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function _init()
switch ($this->vars->actionID) {
case 'save_image':
$contents = $injector->getInstance('IMP_Factory_Contents')->create($this->indices);
if (!($mime_part = $contents->getMIMEPart($this->vars->id))) {
if (!($mime_part = $contents->getMimePart($this->vars->id))) {
$notification->push(_("Could not load message."));
break;
}
Expand Down
6 changes: 3 additions & 3 deletions imp/lib/Compose.php
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ protected function _resumeDraft($indices, $type, $opts)
continue;
}

if (!($part = $contents->getMIMEPart($i))) {
if (!($part = $contents->getMimePart($i))) {
break;
}

Expand Down Expand Up @@ -3033,7 +3033,7 @@ protected function _getMessageText($contents, array $options = array())
}
}

if (!($part = $contents->getMIMEPart($body_id))) {
if (!($part = $contents->getMimePart($body_id))) {
return null;
}
$type = $part->getType();
Expand Down Expand Up @@ -3161,7 +3161,7 @@ protected function _getMessageText($contents, array $options = array())
*/
public function _getMessageTextCallback($id, $attribute, $node)
{
if ($part = $this->getMetadata('related_contents')->getMIMEPart($id)) {
if ($part = $this->getMetadata('related_contents')->getMimePart($id)) {
$atc = $this->addAttachmentFromPart($part);
$this->addRelatedAttachment($atc, $node, $attribute);
return $atc->viewUrl();
Expand Down
24 changes: 12 additions & 12 deletions imp/lib/Contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function getBodyPart($id, $options = array())
if (!$this->_indices || $this->isEmbedded($id)) {
if (empty($options['mimeheaders']) ||
in_array($id, $this->_embedded)) {
$ob = $this->getMIMEPart($id, array('nocontents' => true));
$ob = $this->getMimePart($id, array('nocontents' => true));

if (empty($options['stream'])) {
if (!is_null($ob)) {
Expand All @@ -250,7 +250,7 @@ public function getBodyPart($id, $options = array())
}

$body = '';
$part = $this->getMIMEPart(
$part = $this->getMimePart(
$base_id->id,
array('nocontents' => true)
);
Expand Down Expand Up @@ -514,7 +514,7 @@ public function getMIMEMessage()
* @return Horde_Mime_Part The raw MIME part asked for. If not found,
* returns null.
*/
public function getMIMEPart($id, $options = array())
public function getMimePart($id, $options = array())
{
$this->_buildMessage();

Expand Down Expand Up @@ -578,7 +578,7 @@ public function renderMIMEPart($mime_id, $mode, array $options = array())
$this->_buildMessage();

$mime_part = empty($options['mime_part'])
? $this->getMIMEPart($mime_id)
? $this->getMimePart($mime_id)
: $options['mime_part'];
if (!$mime_part) {
return array($mime_id => null);
Expand Down Expand Up @@ -721,7 +721,7 @@ public function generatePreview()

// Retrieve 3x the size of $maxlen of bodytext data. This should
// account for any content-encoding & HTML tags.
$pmime = $this->getMIMEPart($mimeid, array('length' => $maxlen * 3));
$pmime = $this->getMimePart($mimeid, array('length' => $maxlen * 3));

if ($pmime) {
$ptext = Horde_String::convertCharset(
Expand Down Expand Up @@ -810,7 +810,7 @@ public function getSummary($id, $mask = 0)
'strip' => null
);

$mime_part = $this->getMIMEPart($id, array('nocontents' => true));
$mime_part = $this->getMimePart($id, array('nocontents' => true));
if (!$mime_part) {
return $part;
}
Expand Down Expand Up @@ -1107,7 +1107,7 @@ protected function _buildMessage($parts = null)

$last_id = null;

$mime_part = $this->getMIMEPart($id, array('nocontents' => true));
$mime_part = $this->getMimePart($id, array('nocontents' => true));
if (!$mime_part) {
continue;
}
Expand All @@ -1118,7 +1118,7 @@ protected function _buildMessage($parts = null)
);

if ($viewer->embeddedMimeParts() &&
($mime_part = $this->getMIMEPart($id))) {
($mime_part = $this->getMimePart($id))) {
$viewer->setMIMEPart($mime_part);
$new_part = $viewer->getEmbeddedMimeParts();
if (!is_null($new_part)) {
Expand Down Expand Up @@ -1149,7 +1149,7 @@ protected function _buildMessage($parts = null)
public function canDisplay($part, $mask, $type = null)
{
if (!is_object($part) &&
!($part = $this->getMIMEPart($part, array('nocontents' => true)))) {
!($part = $this->getMimePart($part, array('nocontents' => true)))) {
return 0;
}
$viewer = $GLOBALS['injector']->getInstance('IMP_Factory_MimeViewer')->create($part, array('contents' => $this, 'type' => $type));
Expand Down Expand Up @@ -1291,7 +1291,7 @@ public function buildMessageContents($ignore = array())
if (($key != 0) &&
($val != 'message/rfc822') &&
(strpos($val, 'multipart/') === false) &&
($part = $this->getMIMEPart($key))) {
($part = $this->getMimePart($key))) {
$message->alterPart($key, $part);
}
}
Expand Down Expand Up @@ -1333,7 +1333,7 @@ public function findMimeType($id, $type)
$id_ob = new Horde_Mime_Id($id);

while (($id_ob->id = $id_ob->idArithmetic($id_ob::ID_UP)) !== null) {
if (($part = $this->getMIMEPart($id_ob->id, array('nocontents' => true))) &&
if (($part = $this->getMimePart($id_ob->id, array('nocontents' => true))) &&
($part->getType() == $type)) {
return $part;
}
Expand Down Expand Up @@ -1364,7 +1364,7 @@ public function getPartName(Horde_Mime_Part $part, $use_descrip = false)
case 'multipart':
if (($part->getSubType() == 'related') &&
($view_id = $part->getMetaData('viewable_part')) &&
($viewable = $this->getMIMEPart($view_id, array('nocontents' => true)))) {
($viewable = $this->getMimePart($view_id, array('nocontents' => true)))) {
return $this->getPartName($viewable, $use_descrip);
}
/* Fall-through. */
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Contents/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public static function addToken(array $params = array())
*/
protected function _getRawDownloadPart($id)
{
if (!($mime = $this->_contents->getMIMEPart($id))) {
if (!($mime = $this->_contents->getMimePart($id))) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Indices/Copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function copy($mbox, IMP_Indices $indices, $move)
);

/* Re-flow the message for prettier formatting. */
$body_part = $imp_contents->getMIMEPart(
$body_part = $imp_contents->getMimePart(
$imp_contents->findBody()
);
if (!$body_part) {
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Mime/Viewer/Externalbody.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function _getEmbeddedMimeParts()
if (($part = $base_part->getPart($key)) &&
($part->getContentId() == $cid) &&
($part->getType() != 'message/external-body') &&
($full_part = $imp_contents->getMIMEPart($key))) {
($full_part = $imp_contents->getMimePart($key))) {
$full_part = clone $full_part;
$full_part->setMimeId($this->_mimepart->getMimeId());
// TODO: Add headers from referring body part.
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Mime/Viewer/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ protected function _node($doc, $node)
$tmp = $node->getAttribute('href');

if (($id = $this->_cidSearch($tmp, false)) &&
($mime_part = $this->getConfigParam('imp_contents')->getMIMEPart($id))) {
($mime_part = $this->getConfigParam('imp_contents')->getMimePart($id))) {
$this->_imptmp['style'][] = $mime_part->getContents();
} elseif ($this->_imgBlock()) {
$node->setAttribute(self::CSSBLOCK, $node->getAttribute('href'));
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Mime/Viewer/Mdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected function _renderInfo()
$imp_contents = $this->getConfigParam('imp_contents');
$part3_id = $id_ob->idArithmetic($id_ob::ID_NEXT);

if ($part = $imp_contents->getMIMEPart($part3_id)) {
if ($part = $imp_contents->getMimePart($part3_id)) {
$status->addText(
$imp_contents->linkViewJS(
$part,
Expand Down
4 changes: 2 additions & 2 deletions imp/lib/Mime/Viewer/Pgp.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function _getEmbeddedMimeParts()
/* PGP version information appears in the first MIME subpart. We
* don't currently need to do anything with this information. The
* encrypted data appears in the second MIME subpart. */
if (!($encrypted_part = $imp_contents->getMIMEPart($data_id))) {
if (!($encrypted_part = $imp_contents->getMimePart($data_id))) {
return null;
}

Expand Down Expand Up @@ -427,7 +427,7 @@ protected function _outputPGPSigned()
if ($prefs->getValue('pgp_verify') ||
$injector->getInstance('Horde_Variables')->pgp_verify_msg) {
$imp_contents = $this->getConfigParam('imp_contents');
$sig_part = $imp_contents->getMIMEPart($sig_id);
$sig_part = $imp_contents->getMimePart($sig_id);

$status2 = new IMP_Mime_Status($this->_mimepart);

Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Mime/Viewer/Smil.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function _getRelatedLink($cid)

return (($related_part = $imp_contents->findMimeType($this->_mimepart->getMimeId(), 'multipart/related')) &&
(($key = $related_part->getMetadata('related_ob')->cidSearch($cid)) !== false))
? $imp_contents->getMIMEPart($key)
? $imp_contents->getMimePart($key)
: false;
}

Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Mime/Viewer/Smime.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ protected function _parseSignedData($sig_only = false)
return;
}

if (!($subpart = $imp_contents->getMIMEPart($sig_id))) {
if (!($subpart = $imp_contents->getMimePart($sig_id))) {
try {
$msg_data = $this->_impsmime->extractSignedContents($raw_text);
$subpart = Horde_Mime_Part::parseMessage($msg_data, array('forcemime' => true));
Expand Down
4 changes: 2 additions & 2 deletions imp/lib/Mime/Viewer/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function _renderInfo()
/* Get the action first - it appears in the second part. */
$action = null;
$imp_contents = $this->getConfigParam('imp_contents');
$part2 = $imp_contents->getMIMEPart($part2_id);
$part2 = $imp_contents->getMimePart($part2_id);

foreach (explode("\n", $part2->getContents()) as $line) {
if (stristr($line, 'Action:') !== false) {
Expand Down Expand Up @@ -133,7 +133,7 @@ protected function _renderInfo()
}

/* Display a link to the returned message, if it exists. */
if ($part3 = $imp_contents->getMIMEPart($part3_id)) {
if ($part3 = $imp_contents->getMimePart($part3_id)) {
$status->addText(
$imp_contents->linkViewJS(
$part3,
Expand Down
2 changes: 1 addition & 1 deletion imp/test/Imp/Unit/Mime/Viewer/ItipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function _injectorGetInstance($interface)
if (!isset($this->_contents)) {
$contents= $this->getMock('IMP_Contents', array(), array(), '', false);
$contents->expects($this->any())
->method('getMIMEPart')
->method('getMimePart')
->will($this->returnCallback(array($this, '_getMimePart')));
$this->_contents = $contents;
}
Expand Down

0 comments on commit 7416946

Please sign in to comment.