getLanguageId() public method

Otherwise, it will return NULL.
public getLanguageId ( ) : integer
return integer
Beispiel #1
0
:</TD>
    <TD><?php 
p(camp_format_bytes($attachmentObj->getSizeInBytes()));
?>
</TD>
</TR>
<TR>
    <TD ALIGN="left" colspan="2" style="padding-left: 15px;"><?php 
echo $translator->trans("Should this file only be available for this translation of the article, or for all translations?", array(), 'article_files');
?>
</TD>
</TR>
<TR>
    <TD colspan="2" class="indent"  style="padding-left: 30px;">
    <INPUT type="radio" name="f_language_specific" value="yes" <?php 
if ($attachmentObj->getLanguageId()) {
    ?>
 checked<?php 
}
?>
 <?php 
p($isDisabled);
?>
><?php 
echo $translator->trans("Only this translation", array(), 'article_files');
?>
<br>
    <INPUT type="radio" name="f_language_specific" value="no" <?php 
if (!$attachmentObj->getLanguageId()) {
    ?>
 checked<?php 
Beispiel #2
0
<TR>
	<TD ALIGN="RIGHT"><?php  putGS('Description'); ?>:</TD>
	<TD>
	<INPUT TYPE="TEXT" NAME="f_description" VALUE="<?php echo htmlspecialchars($attachmentObj->getDescription($f_language_selected)); ?>" class="input_text" SIZE="32" <?php p($isReadOnly); ?>>
	</TD>
</TR>
<TR>
	<TD ALIGN="RIGHT"><?php putGS('File Size'); ?>:</TD>
	<TD><?php p(camp_format_bytes($attachmentObj->getSizeInBytes())); ?></TD>
</TR>
<TR>
	<TD ALIGN="left" colspan="2" style="padding-left: 15px;"><?php  putGS("Should this file only be available for this translation of the article, or for all translations?"); ?></TD>
</TR>
<TR>
	<TD colspan="2" class="indent"  style="padding-left: 30px;">
	<INPUT type="radio" name="f_language_specific" value="yes" <?php if ($attachmentObj->getLanguageId()) { ?> checked<?php } ?> <?php p($isDisabled); ?>><?php putGS("Only this translation"); ?><br>
	<INPUT type="radio" name="f_language_specific" value="no" <?php if (!$attachmentObj->getLanguageId()) { ?> checked<?php } ?>  <?php p($isDisabled); ?>><?php putGS("All translations"); ?>
	</TD>
</TR>
<TR>
	<TD ALIGN="left" colspan="2"  style="padding-left: 15px;"><?php  putGS("Do you want this file to open in the user's browser, or to automatically download?"); ?></TD>
</TR>
<TR>
	<TD colspan="2" style="padding-left: 30px;">
	<INPUT type="radio" name="f_content_disposition" value="" <?php if (!$attachmentObj->getContentDisposition()) { ?> checked<?php } ?> <?php p($isDisabled); ?>><?php putGS("Open in the browser"); ?><br>
	<INPUT type="radio" name="f_content_disposition" value="attachment" <?php if ($attachmentObj->getContentDisposition()) { ?> checked<?php } ?> <?php p($isDisabled); ?>><?php putGS("Automatically download"); ?>
	</TD>
</TR>
<?php if ($g_user->hasPermission('ChangeFile')) { ?>
<TR>
	<TD COLSPAN="2">
Beispiel #3
0
<div class="ui-widget-content big-block block-shadow padded-strong">
    <fieldset class="plain">

    <legend><?php 
putGS('Change attachment information');
?>
</legend>

    <ul>
        <li>
            <label for="description"><?php 
putGS("Description");
?>
:</label>
            <input id="description" type="text" name="f_description" value="<?php 
echo htmlspecialchars($object->getDescription($object->getLanguageId()));
?>
" size="50" maxlength="255" class="input_text" />
        </li>
        <li>
            <label><?php 
putGS("Do you want this file to open in the user's browser, or to automatically download?");
?>
</label>
            <input id="disposition0" class="input_radio" type="radio" name="f_content_disposition" value=""<?php 
if ($object->getContentDisposition() == NULL) {
    echo ' checked="checked"';
}
?>
 />
            <label for="disposition0" class="inline-style left-floated" style="padding-right:15px"><?php 
Beispiel #4
0
        TITLE="<?php 
putGS('Download');
?>
" BORDER="0" ALIGN="absmiddle" SRC="<?php 
p($Campsite["ADMIN_IMAGE_BASE_URL"]);
?>
/download.png" /></A></TD>
</TR>
<TR>
    <TD ALIGN="RIGHT"><?php 
putGS('Description');
?>
:</TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="f_description" VALUE="<?php 
echo htmlspecialchars($attachmentObj->getDescription($attachmentObj->getLanguageId()));
?>
" class="input_text" SIZE="32" <?php 
p($isReadOnly);
?>
>
    </TD>
</TR>
<TR>
    <TD ALIGN="RIGHT"><?php 
putGS('File Size');
?>
:</TD>
    <TD><?php 
p(camp_format_bytes($attachmentObj->getSizeInBytes()));
?>
<?php
camp_load_translation_strings("media_archive");
require_once($GLOBALS['g_campsiteDir'].'/classes/Input.php');
require_once($GLOBALS['g_campsiteDir'].'/classes/Attachment.php');
require_once($GLOBALS['g_campsiteDir'].'/classes/Log.php');

if (!SecurityToken::isValid()) {
    camp_html_display_error(getGS('Invalid security token!'));
    exit;
}

// check input
$f_attachment_id = Input::Get('f_attachment_id', 'int', 0);
$f_description = Input::Get('f_description', 'string', '');
$f_content_disposition = Input::Get('f_content_disposition', 'string', '');
if (!Input::IsValid() || ($f_attachment_id <= 0)) {
	camp_html_goto_page("/$ADMIN/media-archive/index.php#files");
}

$object = new Attachment($f_attachment_id);
$object->setDescription($object->getLanguageId(), $f_description);
$object->setContentDisposition($f_content_disposition);

camp_html_add_msg(getGS('Attachment updated.'), 'ok');
camp_html_goto_page("/$ADMIN/media-archive/edit-attachment.php?f_attachment_id=".$object->getAttachmentId());
</dl>

<form name="edit" method="POST" action="do_edit-attachment.php">
    <?php echo SecurityToken::FormParameter(); ?>
    <input type="hidden" name="f_attachment_id" value="<?php echo $object->getAttachmentId(); ?>" />

<div class="ui-widget-content big-block block-shadow padded-strong">
    <fieldset class="plain">

    <legend><?php putGS('Change attachment information'); ?></legend>

    <ul>
        <li>
            <label for="description"><?php putGS("Description"); ?>:</label>
            <input id="description" type="text" name="f_description" value="<?php echo htmlspecialchars($object->getDescription($object->getLanguageId())); ?>" size="50" maxlength="255" class="input_text" />
        </li>
        <li>
            <label><?php putGS("Do you want this file to open in the user's browser, or to automatically download?"); ?></label>
            <input id="disposition0" class="input_radio" type="radio" name="f_content_disposition" value=""<?php if ($object->getContentDisposition() == NULL) { echo ' checked="checked"'; } ?> />
            <label for="disposition0" class="inline-style left-floated" style="padding-right:15px"><?php putGS("Open in the browser"); ?></label>
            <input id="disposition1" class="input_radio" type="radio" name="f_content_disposition" value="attachment"<?php if ($object->getContentDisposition() == 'attachment') { echo ' checked="checked"'; } ?> />
            <label for="disposition1" class="inline-style left-floated"><?php putGS("Automatically download"); ?></label>
        </li>
        <li>
            <label>&nbsp;</label>
            <input type="submit" name="Save" value="<?php  putGS('Save'); ?>" class="button" />
        </li>
    </ul>

    </fieldset>