function displaySubmitForm($iFile, $sAct = '')
{
    global $member;
    global $site;
    if ($iFile && strlen($sAct) > 0) {
        switch ($sAct) {
            case 'share':
                $sAddr = '<div>' . _t("_Enter email(s)") . ':</div><div><input type="text" size="40" name="email"></div>';
                $sSites = '<div style="margin-top:10px; margin-bottom:10px;">' . getSitesArray($iFile, 'Music') . '</div>';
                break;
            case 'report':
                $sAddr = '<input type="hidden" name="email" value="' . $site['email_notify'] . '">';
                $sSites = '';
                break;
        }
        $sCode = '<div class="mediaInfo">';
        $sCode .= '<form name="submitAction" method="post" action="' . $_SERVER['PHP_SELF'] . '">';
        $sCode .= '<input type="hidden" name="fileID" value="' . $iFile . '">';
        $sCode .= $sAddr . $sSites;
        $sCode .= '<div>' . _t("_Message text") . '</div>';
        $sCode .= '<div><textarea cols="30" rows="10" name="messageText"></textarea></div>';
        $sCode .= '<div><input type="submit" size="15" name="send" value="Send">';
        $sCode .= '<input type="reset" size="15" name="send" value="Reset"></div>';
        $sCode .= '</form>';
        $sCode .= '</div>';
    }
    return $sCode;
}
예제 #2
0
function getSitesHtml($sLink, $sTitle = false)
{
    if (!$sTitle) {
        $sTitle = _t('_Share');
    }
    $aSitesPrepare = getSitesArray($sLink);
    $sIconsUrl = getTemplateIcon('digg.png');
    $sIconsUrl = str_replace('digg.png', '', $sIconsUrl);
    $aSites = array();
    foreach ($aSitesPrepare as $k => $r) {
        $aSites[] = array('icon' => $sIconsUrl . $r['icon'], 'name' => $k, 'url' => $r['url']);
    }
    $aVarsContent = array('bx_repeat:sites' => $aSites);
    $aVarsPopup = array('title' => $sTitle, 'content' => $GLOBALS['oSysTemplate']->parseHtmlByName('popup_share.html', $aVarsContent));
    return $GLOBALS['oFunctions']->transBox($GLOBALS['oSysTemplate']->parseHtmlByName('popup.html', $aVarsPopup), true);
}
예제 #3
0
 function getSitesSetBox($sLink)
 {
     require_once BX_DIRECTORY_PATH_INC . 'shared_sites.inc.php';
     $aSites = getSitesArray($sLink);
     $sSpacer = $this->getIconUrl('spacer.gif');
     $aUnits = array();
     foreach ($aSites as $aValue) {
         $aUnits[] = array('icon' => $this->getIconUrl($aValue['icon']), 'href' => $aValue['url'], 'spacer' => $sSpacer);
     }
     return $this->parseHtmlByName('sites_set_box.html', array('bx_repeat:iconBlock' => $aUnits), array('{', '}'));
 }
예제 #4
0
 function getSitesSetBox($sLink)
 {
     require_once BX_DIRECTORY_PATH_INC . 'shared_sites.inc.php';
     $aSites = getSitesArray($sLink);
     $aUnits = array();
     foreach ($aSites as $sName => $aValue) {
         $aUnits[] = array('icon' => $this->getIconUrl($aValue['icon']), 'url' => $aValue['url'], 'name' => $sName);
     }
     return $this->parseHtmlByName('popup_share.html', array('bx_repeat:sites' => $aUnits));
 }
예제 #5
0
 function _actionSharePopup($iEntryId, $sTitle)
 {
     $iEntryId = (int) $iEntryId;
     if (!($aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, 0, true))) {
         echo MsgBox(_t('_Empty'));
         exit;
     }
     require_once BX_DIRECTORY_PATH_INC . "shared_sites.inc.php";
     $sEntryUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aDataEntry[$this->_oDb->_sFieldUri];
     $aSitesPrepare = getSitesArray($sEntryUrl);
     $sIconsUrl = getTemplateIcon('digg.png');
     $sIconsUrl = str_replace('digg.png', '', $sIconsUrl);
     $aSites = array();
     foreach ($aSitesPrepare as $k => $r) {
         $aSites[] = array('icon' => $sIconsUrl . $r['icon'], 'name' => $k, 'url' => $r['url']);
     }
     $aVarsContent = array('bx_repeat:sites' => $aSites);
     $aVarsPopup = array('title' => $sTitle, 'content' => $this->_oTemplate->parseHtmlByName('popup_share', $aVarsContent));
     echo $GLOBALS['oFunctions']->transBox($this->_oTemplate->parseHtmlByName('popup', $aVarsPopup), true);
     exit;
 }
예제 #6
0
 /**
  * Share poll
  *
  * @param $iEntryId integer
  * @return void
  */
 function actionSharePopup($iEntryId = 0)
 {
     $iEntryId = (int) $iEntryId;
     if (!($aDataEntry = $this->_oDb->getPollInfo($iEntryId))) {
         echo MsgBox(_t('_Empty'));
         exit;
     }
     $aDataEntry = array_shift($aDataEntry);
     require_once BX_DIRECTORY_PATH_INC . "shared_sites.inc.php";
     $sEntryUrl = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . '&action=show_poll_info&id=' . $aDataEntry['id_poll'];
     $aSitesPrepare = getSitesArray($sEntryUrl);
     $sIconsUrl = getTemplateIcon('digg.png');
     $sIconsUrl = str_replace('digg.png', '', $sIconsUrl);
     $aSites = array();
     foreach ($aSitesPrepare as $k => $r) {
         $aSites[] = array('icon' => $sIconsUrl . $r['icon'], 'name' => $k, 'url' => $r['url']);
     }
     $aVarsContent = array('bx_repeat:sites' => $aSites);
     $aVarsPopup = array('title' => _t('_Share'), 'content' => $this->_oTemplate->parseHtmlByName('popup_share.html', $aVarsContent));
     header('Content-Type: text/html; charset=utf-8');
     echo $GLOBALS['oFunctions']->transBox($this->_oTemplate->parseHtmlByName('popup.html', $aVarsPopup), true);
     exit;
 }
예제 #7
0
 function actionSharePopup($iSiteId)
 {
     $iSiteId = (int) $iSiteId;
     if (!($aSite = $this->_oDb->getSiteById($iSiteId, 0, true))) {
         echo '<div class="bx_sites_share_popup">' . MsgBox(_t('_Empty')) . '</div>';
         return;
     }
     require_once BX_DIRECTORY_PATH_INC . "shared_sites.inc.php";
     $aSitesPrepare = getSitesArray(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aSite['entryUri']);
     $sIconsUrl = getTemplateIcon('digg.png');
     $sIconsUrl = str_replace('digg.png', '', $sIconsUrl);
     $aSites = array();
     foreach ($aSitesPrepare as $k => $r) {
         $aSites[] = array('icon' => $sIconsUrl . $r['icon'], 'name' => $k, 'url' => $r['url']);
     }
     $aVars = array('title' => _t('_bx_sites_caption_share_site'), 'icon_close_url' => getTemplateImage('close.gif'), 'bx_repeat:sites' => $aSites);
     echo $GLOBALS['oFunctions']->transBox($this->_oTemplate->parseHtmlByName('share_popup.html', $aVars), true);
     exit;
 }