fix merge conflicts

This commit is contained in:
Georg Ehrke 2012-05-07 11:47:14 +02:00
commit 46fe2e3e2a
125 changed files with 943 additions and 677 deletions

View File

@ -21,7 +21,7 @@
*
*/
$l=OC_L10N::get('admin_dependencies_chk');
$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings');
$tmpl = new OCP\Template( 'admin_dependencies_chk', 'settings');
$modules = array();
@ -68,12 +68,24 @@ $modules[] =array(
'modules'=> array('core'),
'message'=> $l->t('The php-ctype module is needed validate data.'));
$modules[] =array(
'status' => class_exists('DOMDocument') ? 'ok' : 'error',
'part'=> 'php-xml',
'modules'=> array('core'),
'message'=> $l->t('The php-xml module is needed to share files with webdav.'));
$modules[] =array(
'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
'part'=> 'allow_url_fopen',
'modules'=> array('core'),
'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
$modules[] =array(
'status' => class_exists('PDO') ? 'ok' : 'warning',
'part'=> 'php-pdo',
'modules'=> array('core'),
'message'=> $l->t('The php-pdo module is needed to store owncloud data into a database.'));
foreach($modules as $key => $module) {
$enabled = false ;
foreach($module['modules'] as $app) {

View File

@ -52,6 +52,6 @@ if (isset($_POST['admin_export'])) {
} else {
// fill template
$tmpl = new OC_Template('admin_migrate', 'settings');
$tmpl = new OCP\Template('admin_migrate', 'settings');
return $tmpl->fetchPage();
}

View File

@ -5,5 +5,6 @@
<description>Bookmark manager for ownCloud</description>
<licence>AGPL</licence>
<author>Arthur Schiwon, Marvin Thomas Rabe</author>
<standalone/>
<require>2</require>
</info>
</info>

View File

@ -32,6 +32,6 @@ OCP\App::setActiveNavigationEntry( 'bookmarks_index' );
OCP\Util::addscript('bookmarks','bookmarks');
OCP\Util::addStyle('bookmarks', 'bookmarks');
$tmpl = new OC_Template( 'bookmarks', 'list', 'user' );
$tmpl = new OCP\Template( 'bookmarks', 'list', 'user' );
$tmpl->printPage();

2
apps/bookmarks/settings.php Normal file → Executable file
View File

@ -6,6 +6,6 @@
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'bookmarks', 'settings');
$tmpl = new OCP\Template( 'bookmarks', 'settings');
return $tmpl->fetchPage();

View File

@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl = new OCP\Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);

View File

@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_App::getCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl = new OCP\Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);

View File

@ -15,7 +15,7 @@ $calendar = array(
'displayname' => '',
'calendarcolor' => '',
);
$tmpl = new OC_Template('calendar', 'part.editcalendar');
$tmpl = new OCP\Template('calendar', 'part.editcalendar');
$tmpl->assign('new', true);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);

View File

@ -29,7 +29,7 @@ $calendarid = OC_Calendar_Calendar::addCalendar($userid, strip_tags($_POST['name
OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::find($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),

View File

@ -10,6 +10,6 @@
$l10n = OC_L10N::get('calendar');
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
$output = new OC_TEMPLATE("calendar", "part.choosecalendar");
$output = new OCP\Template("calendar", "part.choosecalendar");
$output -> printpage();
?>

View File

@ -30,7 +30,7 @@ OC_Calendar_Calendar::editCalendar($calendarid, strip_tags($_POST['name']), null
OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
$calendar = OC_Calendar_App::getCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),

View File

@ -206,9 +206,9 @@ $repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
if($access == 'owner' || $access == 'rw'){
$tmpl = new OC_Template('calendar', 'part.editevent');
$tmpl = new OCP\Template('calendar', 'part.editevent');
}elseif($access == 'r'){
$tmpl = new OC_Template('calendar', 'part.showevent');
$tmpl = new OCP\Template('calendar', 'part.showevent');
}
$tmpl->assign('eventid', $id);

View File

@ -43,7 +43,7 @@ $repeat_bymonth_options = OC_Calendar_App::getByMonthOptions();
$repeat_byweekno_options = OC_Calendar_App::getByWeekNoOptions();
$repeat_bymonthday_options = OC_Calendar_App::getByMonthDayOptions();
$tmpl = new OC_Template('calendar', 'part.newevent');
$tmpl = new OCP\Template('calendar', 'part.newevent');
$tmpl->assign('access', 'owner');
$tmpl->assign('calendar_options', $calendar_options);
$tmpl->assign('repeat_options', $repeat_options);

View File

@ -9,7 +9,7 @@
OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
$tmpl = new OC_Template('calendar', 'part.import');
$tmpl = new OCP\Template('calendar', 'part.import');
$tmpl->assign('path', $_POST['path']);
$tmpl->assign('filename', $_POST['filename']);
$tmpl->printpage();

View File

@ -13,6 +13,6 @@ if($calendar['userid'] != $user){
OCP\JSON::error();
exit;
}
$tmpl = new OC_Template('calendar', 'share.dropdown');
$tmpl = new OCP\Template('calendar', 'share.dropdown');
$tmpl->assign('calid', $calid);
$tmpl->printPage();

View File

@ -53,7 +53,7 @@ OCP\Util::addStyle('', 'jquery.multiselect');
OCP\Util::addscript('contacts','jquery.multi-autocomplete');
OCP\Util::addscript('','oc-vcategories');
OCP\App::setActiveNavigationEntry('calendar_index');
$tmpl = new OC_Template('calendar', 'calendar', 'user');
$tmpl = new OCP\Template('calendar', 'calendar', 'user');
$tmpl->assign('eventSources', $eventSources);
$tmpl->assign('categories', $categories);
if(array_key_exists('showevent', $_GET)){

View File

@ -105,10 +105,11 @@ class OC_Calendar_Object{
$stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_objects (calendarid,objecttype,startdate,enddate,repeating,summary,calendardata,uri,lastmodified) VALUES(?,?,?,?,?,?,?,?,?)' );
$stmt->execute(array($id,$type,$startdate,$enddate,$repeating,$summary,$data,$uri,time()));
$object_id = OCP\DB::insertid('*PREFIX*calendar_objects');
OC_Calendar_Calendar::touchCalendar($id);
return OCP\DB::insertid('*PREFIX*calendar_objects');
return $object_id;
}
/**
@ -124,10 +125,11 @@ class OC_Calendar_Object{
$stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_objects (calendarid,objecttype,startdate,enddate,repeating,summary,calendardata,uri,lastmodified) VALUES(?,?,?,?,?,?,?,?,?)' );
$stmt->execute(array($id,$type,$startdate,$enddate,$repeating,$summary,$data,$uri,time()));
$object_id = OCP\DB::insertid('*PREFIX*calendar_objects');
OC_Calendar_Calendar::touchCalendar($id);
return OCP\DB::insertid('*PREFIX*calendar_objects');
return $object_id;
}
/**

View File

@ -25,7 +25,7 @@ class OC_Calendar_Share{
}else{
$active_where = '';
}
$stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ((share = ? AND sharetype = "user") ' . $group_where . ') AND owner <> ? ' . $permission_where . ' ' . $active_where);
$stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE ((share = ? AND sharetype = 'user') " . $group_where . ") AND owner <> ? " . $permission_where . " " . $active_where);
$result = $stmt->execute(array($userid, $userid));
$return = array();
while( $row = $result->fetchRow()){
@ -160,7 +160,7 @@ class OC_Calendar_Share{
$i = 0;
foreach($groups as $group){
$group_where .= ' OR ';
$group_where .= ' (share = "' . $group . '" AND sharetype = "group") ';
$group_where .= " (share = '" . $group . "' AND sharetype = 'group') ";
$i++;
}
return $group_where;
@ -169,7 +169,7 @@ class OC_Calendar_Share{
$permission_where = '';
if(!is_null($permission)){
$permission_where = ' AND permissions = ';
$permission_where .= ($permission=='rw')?'"1"':'"0"';
$permission_where .= ($permission=='rw')?"'1'":"'0'";
}
return $permission_where;
}
@ -191,7 +191,7 @@ class OC_Calendar_Share{
public static function is_editing_allowed($share, $id, $type){
$group_where = self::group_sql(OC_Group::getUserGroups($share));
$permission_where = self::permission_sql('rw');
$stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ((share = ? AND sharetype = "user") ' . $group_where . ') ' . $permission_where);
$stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE ((share = ? AND sharetype = 'user') " . $group_where . ") " . $permission_where);
$result = $stmt->execute(array($share));
if($result->numRows() == 1){
return true;
@ -211,7 +211,7 @@ class OC_Calendar_Share{
*/
public static function check_access($share, $id, $type){
$group_where = self::group_sql(OC_Group::getUserGroups($share));
$stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE (' . $type . 'id = ? AND (share = ? AND sharetype = "user") ' . $group_where . ')');
$stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE (" . $type . "id = ? AND (share = ? AND sharetype = 'user') " . $group_where . ")");
$result = $stmt->execute(array($id,$share));
$rows = $result->numRows();
if($rows > 0){
@ -229,9 +229,9 @@ class OC_Calendar_Share{
* @return: mixed - bool if false, array with type and id if true
*/
public static function getElementByToken($token){
$stmt_calendar = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . OC_Calendar_Share::CALENDAR . ' WHERE sharetype = "public" AND share = ?');
$stmt_calendar = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . OC_Calendar_Share::CALENDAR . " WHERE sharetype = 'public' AND share = ?");
$result_calendar = $stmt_calendar->execute(array($token));
$stmt_event = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . OC_Calendar_Share::EVENT . ' WHERE sharetype = "public" AND share = ?');
$stmt_event = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . OC_Calendar_Share::EVENT . " WHERE sharetype = 'public' AND share = ?");
$result_event = $stmt_event->execute(array($token));
$return = array();
if($result_calendar->numRows() == 0 && $result_event->numRows() == 0){
@ -253,7 +253,7 @@ class OC_Calendar_Share{
* @param (string) $
*/
public static function set_active($share, $id, $active){
$stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_share_calendar SET active = ? WHERE share = ? AND sharetype = "user" AND calendarid = ?');
$stmt = OCP\DB::prepare("UPDATE *PREFIX*calendar_share_calendar SET active = ? WHERE share = ? AND sharetype = 'user' AND calendarid = ?");
$stmt->execute(array($active, $share, $id));
}
}

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'calendar', 'settings');
$tmpl = new OCP\Template( 'calendar', 'settings');
$timezone=OCP\Config::getUserValue(OCP\USER::getUser(),'calendar','timezone','');
$tmpl->assign('timezone',$timezone);
$tmpl->assign('timezones',DateTimeZone::listIdentifiers());

View File

@ -5,7 +5,7 @@
$option_calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
for($i = 0; $i < count($option_calendars); $i++){
echo "<tr>";
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $option_calendars[$i]);
if(OC_Calendar_Share::allUsersSharedwith($option_calendars[$i]['id'], OC_Calendar_Share::CALENDAR) == array()){
$shared = false;
@ -36,7 +36,7 @@ $count = count($share);
for($i = 0; $i < $count; $i++){
$share[$i]['calendar'] = OC_Calendar_App::getCalendar($share[$i]['calendarid'], false, false);
echo '<tr>';
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields.shared');
$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields.shared');
$tmpl->assign('share', $share[$i]);
$tmpl->printpage();
echo '</tr>';

View File

@ -1,8 +1,8 @@
<?php
echo '<td width="20px"><input id="active_' . $_['calendar']['id'] . '" type="checkbox" onClick="Calendar.UI.Calendar.activation(this,' . $_['calendar']['id'] . ')"' . ($_['calendar']['active'] ? ' checked="checked"' : '') . '></td>';
echo '<td id="' . OCP\USER::getUser() . '_' . $_['calendar']['id'] . '"><label for="active_' . $_['calendar']['id'] . '">' . $_['calendar']['displayname'] . '</label></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.Share.dropdown(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['id'] . '\');" title="' . $l->t("Share Calendar") . '" class="action"><img class="svg action" src="' . ((!$_['shared']) ? '../../core/img/actions/share.svg' : '../../core/img/actions/shared.svg') . '"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.showCalDAVUrl(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['uri'] . '\');" title="' . $l->t("CalDav Link") . '" class="action"><img class="svg action" src="../../core/img/actions/public.svg"></a></td>';
echo '<td width="20px"><a href="export.php?calid=' . $_['calendar']['id'] . '" title="' . $l->t('Download') . '" class="action"><img class="svg action" src="../../core/img/actions/download.svg"></a></td>';
echo '<td width="20px"><a href="#" title="' . $l->t('Edit') . '" class="action" onclick="Calendar.UI.Calendar.edit(this, ' . $_['calendar']['id'] . ');"><img class="svg action" src="../../core/img/actions/rename.svg"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.Calendar.deleteCalendar(\'' . $_['calendar']['id'] . '\');" title="' . $l->t('Delete') . '" class="action"><img class="svg action" src="../../core/img/actions/delete.svg"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.Share.dropdown(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['id'] . '\');" title="' . $l->t("Share Calendar") . '" class="action"><img class="svg action" src="' . ((!$_['shared']) ? OCP\Util::imagePath('core', 'actions/share.svg') : OCP\Util::imagePath('core', 'actions/shared.svg')) . '"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.showCalDAVUrl(\'' . OCP\USER::getUser() . '\', \'' . $_['calendar']['uri'] . '\');" title="' . $l->t("CalDav Link") . '" class="action"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/public.svg').'"></a></td>';
echo '<td width="20px"><a href="?app=calendar&getfile=export.php?calid=' . $_['calendar']['id'] . '" title="' . $l->t('Download') . '" class="action"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/download.svg').'"></a></td>';
echo '<td width="20px"><a href="#" title="' . $l->t('Edit') . '" class="action" onclick="Calendar.UI.Calendar.edit(this, ' . $_['calendar']['id'] . ');"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/rename.svg').'"></a></td>';
echo '<td width="20px"><a href="#" onclick="Calendar.UI.Calendar.deleteCalendar(\'' . $_['calendar']['id'] . '\');" title="' . $l->t('Delete') . '" class="action"><img class="svg action" src="'.OCP\Util::imagePath('core', 'actions/delete.svg').'"></a></td>';

24
apps/calendar/templates/part.eventform.php Normal file → Executable file
View File

@ -27,7 +27,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<th width="75px"><?php echo $l->t("Category");?>:</th>
<td>
<input id="category" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? htmlspecialchars($_['categories']) : '' ?>">
<a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a>
<a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo OCP\image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a>
</td>
<?php if(count($_['calendar_options']) > 1) { ?>
<th width="75px">&nbsp;&nbsp;&nbsp;<?php echo $l->t("Calendar");?>:</th>
@ -35,7 +35,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select style="width:140px;" name="calendar">
<?php
if (!isset($_['calendar'])) {$_['calendar'] = false;}
echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
echo OCP\html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
?>
</select>
</td>
@ -101,7 +101,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<td>
<select id="repeat" name="repeat">
<?php
echo html_select_options($_['repeat_options'], $_['repeat']);
echo OCP\html_select_options($_['repeat_options'], $_['repeat']);
?>
</select></td>
<td><input type="button" style="float:right;" class="submit" value="<?php echo $l->t("Advanced"); ?>" onclick="Calendar.UI.showadvancedoptionsforrepeating();" id="advanced_options_button"></td>
@ -114,7 +114,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<td>
<select id="advanced_month_select" name="advanced_month_select">
<?php
echo html_select_options($_['repeat_month_options'], $_['repeat_month']);
echo OCP\html_select_options($_['repeat_month_options'], $_['repeat_month']);
?>
</select>
</td>
@ -126,7 +126,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<td>
<select id="advanced_year_select" name="advanced_year_select">
<?php
echo html_select_options($_['repeat_year_options'], $_['repeat_year']);
echo OCP\html_select_options($_['repeat_year_options'], $_['repeat_year']);
?>
</select>
</td>
@ -138,7 +138,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<td id="weekofmonthcheckbox">
<select id="weekofmonthoptions" name="weekofmonthoptions">
<?php
echo html_select_options($_['repeat_weekofmonth_options'], $_['repeat_weekofmonth']);
echo OCP\html_select_options($_['repeat_weekofmonth_options'], $_['repeat_weekofmonth']);
?>
</select>
</td>
@ -151,7 +151,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="weeklyoptions" name="weeklyoptions[]" multiple="multiple" style="width: 150px;" title="<?php echo $l->t("Select weekdays") ?>">
<?php
if (!isset($_['weekdays'])) {$_['weekdays'] = array();}
echo html_select_options($_['repeat_weekly_options'], $_['repeat_weekdays'], array('combine'=>true));
echo OCP\html_select_options($_['repeat_weekly_options'], $_['repeat_weekdays'], array('combine'=>true));
?>
</select>
</td>
@ -164,7 +164,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="byyearday" name="byyearday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
<?php
if (!isset($_['repeat_byyearday'])) {$_['repeat_byyearday'] = array();}
echo html_select_options($_['repeat_byyearday_options'], $_['repeat_byyearday'], array('combine'=>true));
echo OCP\html_select_options($_['repeat_byyearday_options'], $_['repeat_byyearday'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events day of year.'); ?>
</td>
@ -177,7 +177,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="bymonthday" name="bymonthday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
<?php
if (!isset($_['repeat_bymonthday'])) {$_['repeat_bymonthday'] = array();}
echo html_select_options($_['repeat_bymonthday_options'], $_['repeat_bymonthday'], array('combine'=>true));
echo OCP\html_select_options($_['repeat_bymonthday_options'], $_['repeat_bymonthday'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events day of month.'); ?>
</td>
@ -190,7 +190,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="bymonth" name="bymonth[]" multiple="multiple" title="<?php echo $l->t("Select months") ?>">
<?php
if (!isset($_['repeat_bymonth'])) {$_['repeat_bymonth'] = array();}
echo html_select_options($_['repeat_bymonth_options'], $_['repeat_bymonth'], array('combine'=>true));
echo OCP\html_select_options($_['repeat_bymonth_options'], $_['repeat_bymonth'], array('combine'=>true));
?>
</select>
</td>
@ -203,7 +203,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="byweekno" name="byweekno[]" multiple="multiple" title="<?php echo $l->t("Select weeks") ?>">
<?php
if (!isset($_['repeat_byweekno'])) {$_['repeat_byweekno'] = array();}
echo html_select_options($_['repeat_byweekno_options'], $_['repeat_byweekno'], array('combine'=>true));
echo OCP\html_select_options($_['repeat_byweekno_options'], $_['repeat_byweekno'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events week of year.'); ?>
</td>
@ -222,7 +222,7 @@ echo 'Calendar.UI.Share.idtype = "event";' . "\n" . 'Calendar.UI.Share.currentid
<select id="end" name="end">
<?php
if($_['repeat_end'] == '') $_['repeat_end'] = 'never';
echo html_select_options($_['repeat_end_options'], $_['repeat_end']);
echo OCP\html_select_options($_['repeat_end_options'], $_['repeat_end']);
?>
</select>
</td>

View File

@ -8,7 +8,7 @@
<?php
$calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
$calendar_options[] = array('id'=>'newcal', 'displayname'=>$l->t('create a new calendar'));
echo html_select_options($calendar_options, $calendar_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
echo OCP\html_select_options($calendar_options, $calendar_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
?>
</select>
<div id="newcalform" style="display: none;">

22
apps/calendar/templates/part.showevent.php Normal file → Executable file
View File

@ -23,7 +23,7 @@
echo $l->t('No categories selected');
}else{
echo '<select id="category" name="categories[]" multiple="multiple" title="' . $l->t("Select category") . '">';
echo html_select_options($_['categories'], $_['categories'], array('combine'=>true));
echo OCP\html_select_options($_['categories'], $_['categories'], array('combine'=>true));
echo '</select>';
}
?>
@ -99,7 +99,7 @@
<td>
<select id="repeat" name="repeat">
<?php
echo html_select_options(array($_['repeat_options'][$_['repeat']]), $_['repeat']);
echo OCP\html_select_options(array($_['repeat_options'][$_['repeat']]), $_['repeat']);
?>
</select></td>
<td><input type="button" style="float:right;" class="submit" value="<?php echo $l->t("Advanced"); ?>" onclick="Calendar.UI.showadvancedoptionsforrepeating();" id="advanced_options_button"></td>
@ -112,7 +112,7 @@
<td>
<select id="advanced_month_select" name="advanced_month_select">
<?php
echo html_select_options(array($_['repeat_month_options'][$_['repeat_month']]), $_['repeat_month']);
echo OCP\html_select_options(array($_['repeat_month_options'][$_['repeat_month']]), $_['repeat_month']);
?>
</select>
</td>
@ -124,7 +124,7 @@
<td>
<select id="advanced_year_select" name="advanced_year_select">
<?php
echo html_select_options(array($_['repeat_year_options'][$_['repeat_year']]), $_['repeat_year']);
echo OCP\html_select_options(array($_['repeat_year_options'][$_['repeat_year']]), $_['repeat_year']);
?>
</select>
</td>
@ -136,7 +136,7 @@
<td id="weekofmonthcheckbox">
<select id="weekofmonthoptions" name="weekofmonthoptions">
<?php
echo html_select_options(array($_['repeat_weekofmonth_options'][$_['repeat_weekofmonth']]), $_['repeat_weekofmonth']);
echo OCP\html_select_options(array($_['repeat_weekofmonth_options'][$_['repeat_weekofmonth']]), $_['repeat_weekofmonth']);
?>
</select>
</td>
@ -149,7 +149,7 @@
<select id="weeklyoptions" name="weeklyoptions[]" multiple="multiple" style="width: 150px;" title="<?php echo $l->t("Select weekdays") ?>">
<?php
if (!isset($_['weekdays'])) {$_['weekdays'] = array();}
echo html_select_options(array($_['repeat_weekly_options'][$_['repeat_weekdays']]), $_['repeat_weekdays'], array('combine'=>true));
echo OCP\html_select_options(array($_['repeat_weekly_options'][$_['repeat_weekdays']]), $_['repeat_weekdays'], array('combine'=>true));
?>
</select>
</td>
@ -162,7 +162,7 @@
<select id="byyearday" name="byyearday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
<?php
if (!isset($_['repeat_byyearday'])) {$_['repeat_byyearday'] = array();}
echo html_select_options(array($_['repeat_byyearday_options'][$_['repeat_byyearday']]), $_['repeat_byyearday'], array('combine'=>true));
echo OCP\html_select_options(array($_['repeat_byyearday_options'][$_['repeat_byyearday']]), $_['repeat_byyearday'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events day of year.'); ?>
</td>
@ -175,7 +175,7 @@
<select id="bymonthday" name="bymonthday[]" multiple="multiple" title="<?php echo $l->t("Select days") ?>">
<?php
if (!isset($_['repeat_bymonthday'])) {$_['repeat_bymonthday'] = array();}
echo html_select_options(array($_['repeat_bymonthday_options'][$_['repeat_bymonthday']]), $_['repeat_bymonthday'], array('combine'=>true));
echo OCP\html_select_options(array($_['repeat_bymonthday_options'][$_['repeat_bymonthday']]), $_['repeat_bymonthday'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events day of month.'); ?>
</td>
@ -188,7 +188,7 @@
<select id="bymonth" name="bymonth[]" multiple="multiple" title="<?php echo $l->t("Select months") ?>">
<?php
if (!isset($_['repeat_bymonth'])) {$_['repeat_bymonth'] = array();}
echo html_select_options(array($_['repeat_bymonth_options'][$_['repeat_bymonth']]), $_['repeat_bymonth'], array('combine'=>true));
echo OCP\html_select_options(array($_['repeat_bymonth_options'][$_['repeat_bymonth']]), $_['repeat_bymonth'], array('combine'=>true));
?>
</select>
</td>
@ -201,7 +201,7 @@
<select id="byweekno" name="byweekno[]" multiple="multiple" title="<?php echo $l->t("Select weeks") ?>">
<?php
if (!isset($_['repeat_byweekno'])) {$_['repeat_byweekno'] = array();}
echo html_select_options(array($_['repeat_byweekno_options'][$_['repeat_byweekno']]), $_['repeat_byweekno'], array('combine'=>true));
echo OCP\html_select_options(array($_['repeat_byweekno_options'][$_['repeat_byweekno']]), $_['repeat_byweekno'], array('combine'=>true));
?>
</select><?php echo $l->t('and the events week of year.'); ?>
</td>
@ -220,7 +220,7 @@
<select id="end" name="end">
<?php
if($_['repeat_end'] == '') $_['repeat_end'] = 'never';
echo html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']);
echo OCP\html_select_options(array($_['repeat_end_options'][$_['repeat_end']]), $_['repeat_end']);
?>
</select>
</td>

View File

@ -28,7 +28,7 @@ foreach($allocusers as $ocuser){
}
unset($allusers[OCP\USER::getUser()]);
$allusers = array_flip($allusers);
echo html_select_options($allusers, array());
echo OCP\html_select_options($allusers, array());
?>
</select><br>
<ul id="sharewithuser_list">
@ -54,7 +54,7 @@ $allgroups = array();
foreach($allocgroups as $ocgroup){
$allgroups[$ocgroup] = $ocgroup;
}
echo html_select_options($allgroups, array());
echo OCP\html_select_options($allgroups, array());
?>
</select><br>
<ul id="sharewithgroup_list">

View File

@ -13,7 +13,7 @@ $book = array(
'id' => 'new',
'displayname' => '',
);
$tmpl = new OC_Template('contacts', 'part.editaddressbook');
$tmpl = new OCP\Template('contacts', 'part.editaddressbook');
$tmpl->assign('new', true);
$tmpl->assign('addressbook', $book);
$tmpl->printPage();

View File

@ -10,5 +10,5 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
$output = new OC_TEMPLATE("contacts", "part.chooseaddressbook");
$output = new OCP\Template("contacts", "part.chooseaddressbook");
$output -> printpage();

View File

@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('contacts');
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
$contacts = OC_Contacts_VCard::all($ids);
$tmpl = new OC_TEMPLATE("contacts", "part.contacts");
$tmpl = new OCP\Template("contacts", "part.contacts");
$tmpl->assign('contacts', $contacts);
$page = $tmpl->fetchPage();

View File

@ -32,7 +32,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
//exit();
}
$addressbook = OC_Contacts_App::getAddressbook($bookid);
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl->assign('addressbook', $addressbook);
OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),

View File

@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('contacts');
$tmp_path = $_GET['tmp_path'];
$id = $_GET['id'];
OCP\Util::writeLog('contacts','ajax/cropphoto.php: tmp_path: '.$tmp_path.', exists: '.file_exists($tmp_path), OCP\Util::DEBUG);
$tmpl = new OC_TEMPLATE("contacts", "part.cropphoto");
$tmpl = new OCP\Template("contacts", "part.cropphoto");
$tmpl->assign('tmp_path', $tmp_path);
$tmpl->assign('id', $id);
$page = $tmpl->fetchPage();

View File

@ -15,7 +15,7 @@ $checksum = isset($_GET['checksum'])?$_GET['checksum']:'';
$vcard = OC_Contacts_App::getContactVCard($id);
$adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
$tmpl = new OC_TEMPLATE("contacts", "part.edit_address_dialog");
$tmpl = new OCP\Template("contacts", "part.edit_address_dialog");
if($checksum) {
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
$element = $vcard->children[$line];

View File

@ -10,7 +10,7 @@
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
$addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']);
$tmpl = new OC_Template("contacts", "part.editaddressbook");
$tmpl = new OCP\Template("contacts", "part.editaddressbook");
$tmpl->assign('new', false);
$tmpl->assign('addressbook', $addressbook);
$tmpl->printPage();

View File

@ -18,7 +18,7 @@ function debug($msg) {
OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG);
}
$tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog");
$tmpl = new OCP\Template("contacts", "part.edit_name_dialog");
$id = isset($_GET['id'])?$_GET['id']:'';
debug('id: '.$id);

View File

@ -16,7 +16,7 @@ $freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$tmpl = new OC_Template('contacts', 'part.importaddressbook');
$tmpl = new OCP\Template('contacts', 'part.importaddressbook');
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->printpage();

View File

@ -9,7 +9,7 @@
OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('contacts');
$tmpl = new OC_Template('contacts', 'part.import');
$tmpl = new OCP\Template('contacts', 'part.import');
$tmpl->assign('path', $_POST['path']);
$tmpl->assign('filename', $_POST['filename']);
$tmpl->printpage();

View File

@ -49,7 +49,7 @@ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
$phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
$email_types = OC_Contacts_App::getTypesOfProperty('EMAIL');
$tmpl = new OC_Template('contacts','part.contact');
$tmpl = new OCP\Template('contacts','part.contact');
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('adr_types',$adr_types);

View File

@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
$tmpl = new OC_Template('contacts','part.no_contacts');
$tmpl = new OCP\Template('contacts','part.no_contacts');
$page = $tmpl->fetchPage();
OCP\JSON::success(array('data' => array( 'page' => $page )));

View File

@ -53,7 +53,7 @@ foreach($vcard->children as $property){
}
}
$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto");
$tmpl = new OCP\Template("contacts", "part.contactphoto");
$tmpl->assign('id', $id);
if($refresh) {
$tmpl->assign('refresh', 1);

View File

@ -101,7 +101,7 @@ if(file_exists($tmp_path)) {
}
unlink($tmpfname);
//$result=array( "status" => "success", 'mime'=>$image->mimeType(), 'tmp'=>$tmp_path);
$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto");
$tmpl = new OCP\Template("contacts", "part.contactphoto");
$tmpl->assign('tmp_path', $tmpfname);
$tmpl->assign('mime', $image->mimeType());
$tmpl->assign('id', $id);

View File

@ -35,7 +35,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) {
}
$addressbook = OC_Contacts_App::getAddressbook($bookid);
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl->assign('addressbook', $addressbook);
OCP\JSON::success(array(
'page' => $tmpl->fetchPage(),

View File

@ -6,5 +6,6 @@
<author>Jakob Sack</author>
<require>2</require>
<description>Address book with CardDAV support.</description>
<standalone/>
<default_enable/>
</info>

View File

@ -1,9 +1,9 @@
/*dl > dt {
font-weight: bold;
}*/
#leftcontent { top: 3.5em !important; }
#leftcontent { top: 3.5em !important; padding: 0; margin: 0; }
#rightcontent { top: 3.5em !important; padding-top: 5px; }
#contacts { background: #fff; width: 20em; top: 3.7em; bottom:3em; position: fixed; overflow: auto; }
#contacts { background: #fff; width: 20em; left: 12.5em; top: 3.7em; bottom:3em; position: fixed; overflow: auto; padding: 0; margin: 0; }
#bottomcontrols { padding: 0; bottom:0px; height:2.8em; width: 20em; margin:0; background:#eee; border-top:1px solid #ccc; position:fixed; -moz-box-shadow: 0 0 0 #000, -3px 0 7px #000; -webkit-box-shadow: 0 0 0 #000, -3px 0 7px #000; box-shadow: 0 0 0 #000, -3px 0 7px #000;}
#contacts_newcontact { float: left; margin: 0.2em 0 0 1em; }
#chooseaddressbook { float: right; margin: 0.2em 1em 0 0; }
@ -25,10 +25,7 @@
#card input[type="text"].contacts_property,input[type="email"].contacts_property { width: 14em; float: left; font-weight: bold; }
.categories { float: left; width: 16em; }
#card input[type="text"],input[type="email"],input[type="tel"],input[type="date"], select, textarea { background-color: #fefefe; border: 0 !important; -webkit-appearance:none !important; -moz-appearance:none !important; -webkit-box-sizing:none !important; -moz-box-sizing:none !important; box-sizing:none !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; float: left; }
#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; }
textarea:focus, textarea:hover { background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; }
input[type="text"]:invalid,input[type="email"]:invalid,input[type="tel"]:invalid,input[type="date"]:invalid, textarea:invalid { color: #bbb !important; }
#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active, textarea:focus, textarea:hover { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #ddd, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #ddd, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; }
textarea { width: 80%; min-height: 5em; min-width: 30em; margin: 0 !important; padding: 0 !important; outline: 0 !important;}
dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
.form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom; color: #bbb;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ }
@ -101,7 +98,8 @@ input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
.propertycontainer dd { float: left; width: 25em; }
.propertylist { clear: none; max-width: 28em; }
.propertylist li.propertycontainer { white-space: nowrap; min-width: 35em; /*max-width: 30em;*/ display: block; clear: right; }
.propertylist li > input[type="text"],input[type="email"],input[type="tel"] { float: left; max-width: 15em; }
.propertycontainer[data-element="EMAIL"] > input[type="email"] { min-width: 19em !important; float: left; }
.propertycontainer[data-element="TEL"] > input[type="text"] { width: 10em !important; float: left; }
.propertylist li > input[type="checkbox"],input[type="radio"] { float: left; clear: left; width: 20px; height: 20px; vertical-align: middle; }
.propertylist li > select { float: left; max-width: 8em; }
.typelist { float: left; max-width: 10em; border: 0; background-color: #fff; } /* for multiselect */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 658 B

View File

@ -7,10 +7,34 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="16"
height="16"
id="svg3796">
width="20"
height="20"
id="svg3796"
inkscape:version="0.48.2 r9819"
sodipodi:docname="contact-new.svg">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview18"
showgrid="false"
inkscape:zoom="11.8"
inkscape:cx="10"
inkscape:cy="10"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg3796" />
<defs
id="defs3798">
<linearGradient
@ -29,12 +53,13 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1">
id="layer1"
transform="matrix(1.2460746,0,0,1.2420314,-0.12303732,-0.51608095)">
<g
transform="matrix(1.0633871,0,0,1.0633871,-0.03169354,-0.53733376)"
id="g4344">
@ -97,7 +122,8 @@
<path
d="m 10.823783,8.4435567 1.999999,0 0,1.9999993 2,0 0,2 -2,0 0,2 -1.999999,0 0,-2 -2.0000004,0 0,-2 2.0000004,0 z"
id="path4336"
style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
inkscape:connector-curvature="0" />
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -58,7 +58,7 @@ OCP\Util::addStyle('contacts','jquery.combobox');
OCP\Util::addStyle('contacts','jquery.Jcrop');
OCP\Util::addStyle('contacts','contacts');
$tmpl = new OC_Template( "contacts", "index", "user" );
$tmpl = new OCP\Template( "contacts", "index", "user" );
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('property_types', $property_types);

View File

@ -168,14 +168,14 @@ Contacts={
honsuf:'',
data:undefined,
update:function(id) {
// Make sure proper DOM is loaded.
var newid;
if(id == undefined) {
newid = $('#contacts li:first-child').data('id');
} else {
newid = id;
}
if(!$('n')) {
// Make sure proper DOM is loaded.
if(!$('#card')) {
$.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){
if(jsondata.status == 'success'){
$('#rightcontent').html(jsondata.data.page);
@ -185,8 +185,6 @@ Contacts={
});
}
if($('#contacts li').length > 0) {
//var newid = $('#contacts li:first-child').data('id');
//$('#contacts li:first-child').addClass('active');
$('#leftcontent li[data-id="'+newid+'"]').addClass('active');
$.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){
if(jsondata.status == 'success'){
@ -210,8 +208,6 @@ Contacts={
},
doExport:function() {
document.location.href = OC.linkTo('contacts', 'export.php') + '?contactid=' + this.id;
//$.get(OC.linkTo('contacts', 'export.php'),{'contactid':this.id},function(jsondata){
//});
},
doImport:function(){
Contacts.UI.notImplemented();
@ -249,7 +245,7 @@ Contacts={
if(!added) {
$('#leftcontent ul').append(item);
}
if(isnew) {
if(isnew) { // add some default properties
Contacts.UI.Card.addProperty('EMAIL');
Contacts.UI.Card.addProperty('TEL');
Contacts.UI.Card.addProperty('NICKNAME');
@ -261,7 +257,6 @@ Contacts={
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
//alert(jsondata.data.message);
}
});
$('#contact_identity').show();
@ -291,11 +286,10 @@ Contacts={
newid = newlistitem.data('id');
}
$('#rightcontent').data('id',newid);
//$('#rightcontent').empty();
this.id = this.fn = this.fullname = this.shortname = this.famname = this.givname = this.addname = this.honpre = this.honsuf = '';
this.data = undefined;
// Load first in list.
if($('#contacts li').length > 0) {
if($('#contacts li').length > 0) { // Load first in list.
Contacts.UI.Card.update(newid);
} else {
// load intro page
@ -313,7 +307,6 @@ Contacts={
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
//alert(jsondata.data.message);
}
});
}
@ -321,7 +314,6 @@ Contacts={
return false;
},
loadContact:function(jsondata){
//$('#contact_communication').hide();
this.data = jsondata;
this.id = this.data.id;
$('#rightcontent').data('id',this.id);
@ -508,7 +500,6 @@ Contacts={
}
},
saveProperty:function(obj){
// I couldn't get the selector to filter on 'contacts_property' so I filter by hand here :-/
if(!$(obj).hasClass('contacts_property')) {
return false;
}
@ -569,7 +560,6 @@ Contacts={
}
},
addProperty:function(type){
//console.log('addProperty:' + type);
switch (type) {
case 'PHOTO':
this.loadPhoto(true);
@ -617,7 +607,6 @@ Contacts={
deleteProperty:function(obj, type){
Contacts.UI.loading(obj, true);
var checksum = Contacts.UI.checksumFor(obj);
//console.log('deleteProperty, id: ' + this.id + ', checksum: ' + checksum);
if(checksum) {
$.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){
if(jsondata.status == 'success'){
@ -822,16 +811,13 @@ Contacts={
if(isnew) {
container.remove();
}
//Contacts.UI.showHideContactInfo();
}
},
close : function(event, ui) {
//alert('close');
$(this).dialog('destroy').remove();
if(isnew) {
container.remove();
}
//Contacts.UI.showHideContactInfo();
},
open : function(event, ui) {
$( "#adr_city" ).autocomplete({
@ -848,9 +834,6 @@ Contacts={
},
success: function( data ) {
response( $.map( data.geonames, function( item ) {
/*for(var key in item) {
console.log(key + ': ' + item[key]);
}*/
return {
label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
value: item.name,
@ -865,9 +848,6 @@ Contacts={
if(ui.item && $('#adr_country').val().trim().length == 0) {
$('#adr_country').val(ui.item.country);
}
/*log( ui.item ?
"Selected: " + ui.item.label :
"Nothing selected, input was " + this.value);*/
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
@ -892,9 +872,6 @@ Contacts={
},
success: function( data ) {
response( $.map( data.geonames, function( item ) {
//for(var key in item) {
// console.log(key + ': ' + item[key]);
//}
return {
label: item.name,
value: item.name
@ -1245,12 +1222,9 @@ Contacts={
function(jsondata) {
if (jsondata.status == 'success'){
$(obj).closest('tr').remove();
//$('#chooseaddressbook_dialog').dialog('destroy').remove();
Contacts.UI.Contacts.update();
//Contacts.UI.Addressbooks.overview();
} else {
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
//alert('Error: ' + data.message);
}
});
}
@ -1480,7 +1454,6 @@ $(document).ready(function(){
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
//alert(jsondata.data.message);
}
});
return false;
@ -1507,9 +1480,6 @@ $(document).ready(function(){
}
});
// NOTE: For some reason the selector doesn't work when I select by '.contacts_property' too...
// I do the filtering in the event handler instead.
//$('input[type="text"],input[type="checkbox"],input[type="email"],input[type="tel"],input[type="date"], select').live('change', function(){
$('.contacts_property').live('change', function(){
Contacts.UI.Card.saveProperty(this);
});
@ -1523,7 +1493,7 @@ $(document).ready(function(){
});
// Name has changed. Update it and reorder.
$('#fn').live('change',function(){
$('#fn').change(function(){
var name = $('#fn').val();
var item = $('#contacts [data-id="'+Contacts.UI.Card.id+'"]').clone();
$('#contacts [data-id="'+Contacts.UI.Card.id+'"]').remove();
@ -1541,9 +1511,7 @@ $(document).ready(function(){
}
});
/**
* Profile picture upload handling
*/
// Profile picture upload handling
// New profile picture selected
$('#file_upload_start').change(function(){
Contacts.UI.Card.uploadPhoto(this.files);
@ -1594,30 +1562,22 @@ $(document).ready(function(){
OC.dialogs.alert(xhr.status + ': ' + xhr.responseText, t('contacts', 'Error'));
}
} else {
//alert(xhr.responseText);
OC.dialogs.alert(response.data.message, t('contacts', 'Error'));
}
// stop loading indicator
//$('#contacts_details_photo_progress').hide();
}
};
fileUpload.onprogress = function(e){
if (e.lengthComputable){
var _progress = Math.round((e.loaded * 100) / e.total);
if (_progress != 100){
//$('#contacts_details_photo_progress').text(_progress + '%');
//$('#contacts_details_photo_progress').val(_progress);
}
//if (_progress != 100){
//}
}
};
// Start loading indicator.
//$('#contacts_details_photo_progress').show()();
xhr.open('POST', OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true);
xhr.setRequestHeader('Cache-Control', 'no-cache');
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('X_FILE_NAME', encodeURIComponent(file.name));
//xhr.setRequestHeader("X_FILENAME", file.name);
xhr.setRequestHeader('X-File-Size', file.size);
xhr.setRequestHeader('Content-Type', file.type);
xhr.send(file);

2
apps/contacts/settings.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php
$tmpl = new OC_Template( 'contacts', 'settings');
$tmpl = new OCP\Template( 'contacts', 'settings');
return $tmpl->fetchPage();
?>

View File

@ -8,12 +8,12 @@
<?php echo $this->inc("part.contacts"); ?>
</ul>
</div>
<div id="bottomcontrols">
<form>
<button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button>
<button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button>
</form>
</div>
<div id="bottomcontrols">
<form>
<button class="svg" id="contacts_newcontact" title="<?php echo $l->t('Add Contact'); ?>"><img class="svg" src="<?php echo OCP\Util::linkTo('contacts', 'img/contact-new.svg'); ?>" alt="<?php echo $l->t('Add Contact'); ?>" /></button>
<button class="svg" id="chooseaddressbook" title="<?php echo $l->t('Addressbooks'); ?>"><img class="svg" src="core/img/actions/settings.svg" alt="<?php echo $l->t('Addressbooks'); ?>" /></button>
</form>
</div>
<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
<?php
if ($_['id']){

View File

@ -4,7 +4,7 @@
$option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
for($i = 0; $i < count($option_addressbooks); $i++){
echo "<tr>";
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
$tmpl->assign('addressbook', $option_addressbooks[$i]);
$tmpl->assign('active', OC_Contacts_Addressbook::isActive($option_addressbooks[$i]['id']));
$tmpl->printpage();

View File

@ -55,7 +55,7 @@ $id = isset($_['id']) ? $_['id'] : '';
<input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
<input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" />
<select class="hidden" multiple="multiple" name="parameters[TYPE][]">
<?php echo html_select_options($_['email_types'], array()) ?>
<?php echo OCP\html_select_options($_['email_types'], array()) ?>
</select>
<span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a>
<a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li>
@ -69,7 +69,7 @@ $id = isset($_['id']) ? $_['id'] : '';
<input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
<input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" />
<select multiple="multiple" name="parameters[TYPE][]">
<?php echo html_select_options($_['phone_types'], array()) ?>
<?php echo OCP\html_select_options($_['phone_types'], array()) ?>
</select>
<a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li>
</ul>

2
apps/contacts/templates/part.edit_address_dialog.php Normal file → Executable file
View File

@ -15,7 +15,7 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
</dt>
<dd>
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
<?php echo html_select_options($_['adr_types'], $types) ?>
<?php echo OCP\html_select_options($_['adr_types'], $types) ?>
</select>
</dd>
<dt>

2
apps/contacts/templates/part.edit_name_dialog.php Normal file → Executable file
View File

@ -16,7 +16,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null;
<dt><label for="addressbook"><?php echo $l->t('Addressbook'); ?></label></dt>
<dd>
<select id="aid" name="aid" size="1">
<?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
<?php echo OCP\html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
</select>
</dd>
<?php }} ?>

View File

@ -8,7 +8,7 @@
<?php
$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
$contacts_options[] = array('id'=>'newaddressbook', 'displayname'=>$l->t('create a new addressbook'));
echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
?>
</select>
<div id="newaddressbookform" style="display: none;">

View File

@ -14,7 +14,7 @@
<select id="book" name="book" class="float">
<?php
$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
?>
</select>
<span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span>

View File

@ -35,7 +35,7 @@ if (isset($_GET['id'])) {
$url = $sites[$id - 1][1];
OCP\App::setActiveNavigationEntry('external_index' . $id);
$tmpl = new OC_Template('external', 'frame', 'user');
$tmpl = new OCP\Template('external', 'frame', 'user');
$tmpl->assign('url', $url);
$tmpl->printPage();
}

View File

@ -4,7 +4,7 @@ OCP\User::checkAdminUser();
OCP\Util::addscript( "external", "admin" );
$tmpl = new OC_Template( 'external', 'settings');
$tmpl = new OCP\Template( 'external', 'settings');
return $tmpl->fetchPage();
?>

2
apps/external/templates/settings.php vendored Normal file → Executable file
View File

@ -8,7 +8,7 @@
for($i = 0; $i < sizeof($sites); $i++) {
echo '<li><input type="text" name="site_name[]" class="site_name" value="'.$sites[$i][0].'" placeholder="'.$l->t('Name').'" />
<input type="text" class="site_url" name="site_url[]" value="'.$sites[$i][1].'" placeholder="'.$l->t('URL').'" />
<img class="svg action delete_button" src="'.image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" />
<img class="svg action delete_button" src="'.OCP\image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" />
</li>';
}
?>

View File

@ -51,7 +51,7 @@ $allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true))
OCP\App::setActiveNavigationEntry( "files_administration" );
$tmpl = new OC_Template( 'files', 'admin' );
$tmpl = new OCP\Template( 'files', 'admin' );
$tmpl->assign( 'htaccessWorking', $htaccessWorking );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));

View File

@ -24,7 +24,7 @@ if($doBreadcrumb){
}
}
$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$data['breadcrumb'] = $breadcrumbNav->fetchPage();
@ -37,7 +37,7 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
$files[] = $i;
}
$list = new OC_Template( "files", "part.list", "" );
$list = new OCP\Template( "files", "part.list", "" );
$list->assign( "files", $files );
$data = array('files' => $list->fetchPage());

View File

@ -17,7 +17,7 @@ $mimetype = isset($_GET['mimetype']) ? $_GET['mimetype'] : '';
$files = array();
foreach( OC_Files::getdirectorycontent( $dir, $mimetype ) as $i ){
$i["date"] = OCP\Util::formatDate($i["mtime"] );
$i['mimetype_icon'] = $i['type'] == 'dir' ? mimetype_icon('dir'): mimetype_icon($i['mimetype']);
$i['mimetype_icon'] = $i['type'] == 'dir' ? OCP\mimetype_icon('dir'): OCP\mimetype_icon($i['mimetype']);
$files[] = $i;
}

View File

@ -6,5 +6,6 @@
<licence>AGPL</licence>
<author>Robin Appelman</author>
<require>2</require>
<standalone/>
<default_enable/>
</info>

View File

@ -22,11 +22,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication');
require_once('../lib/base.php');
// Backends
$authBackend = new OC_Connector_Sabre_Auth();

View File

@ -31,7 +31,7 @@ $filename = $_GET["file"];
if(!OC_Filesystem::file_exists($filename)){
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template( '', '404', 'guest' );
$tmpl = new OCP\Template( '', '404', 'guest' );
$tmpl->assign('file',$filename);
$tmpl->printPage();
exit;

View File

@ -72,11 +72,11 @@ foreach( explode( "/", $dir ) as $i ){
}
// make breadcrumb und filelist markup
$list = new OC_Template( "files", "part.list", "" );
$list = new OCP\Template( "files", "part.list", "" );
$list->assign( "files", $files );
$list->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir=");
$list->assign( "downloadURL", OCP\Util::linkTo("files", "download.php")."?file=");
$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
$breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$breadcrumbNav->assign( "baseURL", OCP\Util::linkTo("files", "index.php")."?dir=");
@ -88,7 +88,7 @@ $freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$tmpl = new OC_Template( "files", "index", "user" );
$tmpl = new OCP\Template( "files", "index", "user" );
$tmpl->assign( "fileList", $list->fetchPage() );
$tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
$tmpl->assign( 'dir', $dir);

View File

@ -52,7 +52,7 @@ foreach( explode( "/", $dir ) as $i ){
}
// return template
$tmpl = new OC_Template( "files", "index", "user" );
$tmpl = new OCP\Template( "files", "index", "user" );
$tmpl->assign( 'files', $files );
$tmpl->assign( "breadcrumb", $breadcrumb );
$tmpl->printPage();

View File

@ -6,9 +6,9 @@
<div id='new' class='button'>
<a><?php echo $l->t('New');?></a>
<ul class="popup popupTop">
<li style="background-image:url('<?php echo mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
<li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
<li style="background-image:url('<?php echo image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li>
<li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
<li style="background-image:url('<?php echo OCP\mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
<li style="background-image:url('<?php echo OCP\image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li>
</ul>
</div>
<div class="file_upload_wrapper svg">
@ -16,7 +16,7 @@
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo htmlentities($_['dir']) ?>" id="dir">
<button class="file_upload_filename">&nbsp;<img class='svg action' alt="Upload" src="<?php echo image_path("core", "actions/upload.svg"); ?>" /></button>
<button class="file_upload_filename">&nbsp;<img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload.svg"); ?>" /></button>
<input class="file_upload_start" type="file" name='files[]'/>
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
@ -46,14 +46,14 @@
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" id="select_all" /><?php } ?>
<span class='name'><?php echo $l->t( 'Name' ); ?></span>
<span class='selectedActions'>
<a href="" class="share"><img class='svg' alt="Share" src="<?php echo image_path("core", "actions/share.svg"); ?>" /> <?php echo $l->t('Share')?></a>
<a href="" class="share"><img class='svg' alt="Share" src="<?php echo OCP\image_path("core", "actions/share.svg"); ?>" /> <?php echo $l->t('Share')?></a>
<?php if($_['allowZipDownload']) : ?>
<a href="" class="download"><img class='svg' alt="Download" src="<?php echo image_path("core", "actions/download.svg"); ?>" /> <?php echo $l->t('Download')?></a>
<a href="" class="download"><img class='svg' alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /> <?php echo $l->t('Download')?></a>
<?php endif; ?>
</span>
</th>
<th id="headerSize"><?php echo $l->t( 'Size' ); ?></th>
<th id="headerDate"><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete all')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo image_path("core", "actions/delete.svg"); ?>" /></a></span></th>
<th id="headerDate"><span id="modified"><?php echo $l->t( 'Modified' ); ?></span><span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Delete all')?> <img class="svg" alt="<?php echo $l->t('Delete')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span></th>
</tr>
</thead>
<tbody id="fileList" data-readonly="<?php echo $_['readonly'];?>">

2
apps/files/templates/part.breadcrumb.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo image_path('core','breadcrumb.png');?>")'>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $crumb["dir"];?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].$crumb["dir"]; ?>"><?php echo htmlentities($crumb["name"]); ?></a>
</div>
<?php endfor;?>

8
apps/files/templates/part.list.php Normal file → Executable file
View File

@ -1,9 +1,9 @@
<?php foreach($_['files'] as $file):
$write = ($file['writable']) ? 'true' : 'false';
$simple_file_size = simple_file_size($file['size']);
$simple_file_size = OCP\simple_file_size($file['size']);
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2
if($simple_size_color<0) $simple_size_color = 0;
$relative_modified_date = relative_modified_date($file['mtime']);
$relative_modified_date = OCP\relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
if($relative_date_color>200) $relative_date_color = 200;
$name = str_replace('+','%20',urlencode($file['name']));
@ -11,7 +11,7 @@
$directory = str_replace('+','%20',urlencode($file['directory']));
$directory = str_replace('%2F','/', $directory); ?>
<tr data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mimetype']?>" data-size='<?php echo $file['size'];?>' data-write='<?php echo $write;?>'>
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mimetype']); ?>)">
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo OCP\mimetype_icon('dir'); else echo OCP\mimetype_icon($file['mimetype']); ?>)">
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$directory.'/'.$name; else echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
<span class="nametext">
@ -27,7 +27,7 @@
<?php endif;?>
</a>
</td>
<td class="filesize" title="<?php echo human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td>
<td class="filesize" title="<?php echo OCP\human_file_size($file['size']); ?>" style="color:rgb(<?php echo $simple_size_color.','.$simple_size_color.','.$simple_size_color ?>)"><?php echo $simple_file_size; ?></td>
<td class="date"><span class="modified" title="<?php echo $file['date']; ?>" style="color:rgb(<?php echo $relative_date_color.','.$relative_date_color.','.$relative_date_color ?>)"><?php echo $relative_modified_date; ?></span></td>
</tr>
<?php endforeach; ?>

View File

@ -6,7 +6,7 @@
* See the COPYING-README file.
*/
$tmpl = new OC_Template( 'files_encryption', 'settings');
$tmpl = new OCP\Template( 'files_encryption', 'settings');
$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
$tmpl->assign('blacklist',$blackList);

View File

@ -1,36 +1,69 @@
<?php
//$RUNTIME_NOAPPS = true;
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
OCP\JSON::checkAppEnabled('files_sharing');
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
OCP\JSON::checkLoggedIn();
$userDirectory = "/".OCP\USER::getUser()."/files";
$source = $userDirectory.$_GET['source'];
$item = array();
$userDirectory = '/'.OCP\USER::getUser().'/files';
$source = $userDirectory.$_GET['item'];
$path = $source;
$users = array();
if ($users = OC_Share::getMySharedItem($source)) {
for ($i = 0; $i < count($users); $i++) {
if ($users[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
$users[$i]['token'] = OC_Share::getTokenFromSource($source);
}
}
}
$source = dirname($source);
while ($source != "" && $source != "/" && $source != "." && $source != $userDirectory) {
if ($values = OC_Share::getMySharedItem($source)) {
$values = array_values($values);
$parentUsers = array();
for ($i = 0; $i < count($values); $i++) {
if ($values[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
$values[$i]['token'] = OC_Share::getTokenFromSource($source)."&path=".substr($path, strlen($source));
// Search for item and shared parent folders
while ($path != $userDirectory) {
if ($rows = OC_Share::getMySharedItem($path)) {
for ($i = 0; $i < count($rows); $i++) {
$uid_shared_with = $rows[$i]['uid_shared_with'];
if ($uid_shared_with == OC_Share::PUBLICLINK && !isset($item['privateLink'])) {
$token = OC_Share::getTokenFromSource($path);
if ($path == $source) {
$item['privateLink'] = $token;
} else {
// If in parent folder, include a path parameter to get direct access to file
$item['privateLink'] = $token.'&path='.substr($source, strlen($path));
}
} else {
// Check if uid_shared_with is a group
if (($pos = strpos($uid_shared_with, '@')) !== false) {
$gid = substr($uid_shared_with, $pos + 1);
// Include users in the group so the users can be removed from the list of people to share with
if ($path == $source) {
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => false));
} else {
$group = array(array('gid' => $gid, 'permissions' => $rows[$i]['permissions'], 'users' => OC_Group::usersInGroup($gid), 'parentFolder' => basename($path)));
}
if (!isset($item['groups'])) {
$item['groups'] = $group;
} else if (is_array($item['groups'])) {
$gidExists = false;
$currentGroups = $item['groups'];
// Check if the group is already included
foreach ($currentGroups as $g) {
if ($g['gid'] == $gid) {
$gidExists = true;
}
}
if (!$gidExists) {
$item['groups'] = array_merge($item['groups'], $group);
}
}
} else {
if ($path == $source) {
$user = array(array('uid' => $uid_shared_with, 'permissions' => $rows[$i]['permissions'], 'parentFolder' => false));
} else {
$user = array(array('uid' => $uid_shared_with, 'permissions' => $rows[$i]['permissions'], 'parentFolder' => basename($path)));
}
if (!isset($item['users'])) {
$item['users'] = $user;
} else if (is_array($item['users'])) {
$item['users'] = array_merge($item['users'], $user);
}
}
}
$parentUsers[basename($source)."-".$i] = $values[$i];
}
$users = array_merge($users, $parentUsers);
}
$source = dirname($source);
}
if (!empty($users)) {
OCP\JSON::encodedPrint($users);
$path = dirname($path);
}
OCP\JSON::success(array('data' => $item));
?>

View File

@ -0,0 +1,25 @@
<?php
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
OCP\JSON::checkAppEnabled('files_sharing');
OCP\JSON::checkLoggedIn();
$items = array();
$userDirectory = '/'.OCP\USER::getUser().'/files';
$dirLength = strlen($userDirectory);
if ($rows = OC_Share::getMySharedItems()) {
for ($i = 0; $i < count($rows); $i++) {
$source = $rows[$i]['source'];
// Strip out user directory
$item = substr($source, $dirLength);
if ($rows[$i]['uid_shared_with'] == OC_Share::PUBLICLINK) {
$items[$item] = true;
} else {
$items[$item] = false;
}
}
}
OCP\JSON::success(array('data' => $items));
?>

View File

@ -1,13 +1,14 @@
<?php
//$RUNTIME_NOAPPS = true;
OCP\JSON::checkAppEnabled('files_sharing');
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
$uid_shared_with = $_GET['uid_shared_with'];
$permissions = $_GET['permissions'];
OCP\JSON::checkAppEnabled('files_sharing');
OCP\JSON::checkLoggedIn();
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
$uid_shared_with = $_POST['uid_shared_with'];
$permissions = $_POST['permissions'];
OC_Share::setPermissions($source, $uid_shared_with, $permissions);
OCP\JSON::success();
?>

View File

@ -1,31 +1,33 @@
<?php
//$RUNTIME_NOAPPS = true;
OCP\JSON::checkAppEnabled('files_sharing');
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
$userDirectory = "/".OCP\USER::getUser()."/files";
$sources = explode(";", $_POST['sources']);
OCP\JSON::checkAppEnabled('files_sharing');
OCP\JSON::checkLoggedIn();
$userDirectory = '/'.OCP\USER::getUser().'/files';
$sources = explode(';', $_POST['sources']);
$uid_shared_with = $_POST['uid_shared_with'];
$permissions = $_POST['permissions'];
foreach ($sources as $source) {
// Make sure file exists and can be shared
if ($source && OC_FILESYSTEM::file_exists($source) && OC_FILESYSTEM::is_readable($source)) {
$source = $userDirectory.$source;
// If the file doesn't exist, it may be shared with the current user
} else if (!$source = OC_Share::getSource($userDirectory.$source)) {
OCP\Util::writeLog('files_sharing',"Shared file doesn't exists :".$source,OCP\Util::ERROR);
echo "false";
}
try {
$shared = new OC_Share($source, $uid_shared_with, $permissions);
if ($uid_shared_with == OC_Share::PUBLICLINK) {
echo $shared->getToken();
$path = ltrim($source, '/');
$source = $userDirectory.$source;
// Check if the file exists or if the file is being reshared
if ($source && (OC_FILESYSTEM::file_exists($path) && OC_FILESYSTEM::is_readable($path) || OC_Share::getSource($source))) {
try {
$shared = new OC_Share($source, $uid_shared_with, $permissions);
// If this is a private link, return the token
if ($uid_shared_with == OC_Share::PUBLICLINK) {
OCP\JSON::success(array('data' => $shared->getToken()));
} else {
OCP\JSON::success();
}
} catch (Exception $exception) {
OCP\Util::writeLog('files_sharing', 'Unexpected Error : '.$exception->getMessage(), OCP\Util::ERROR);
OCP\JSON::error(array('data' => array('message' => $exception->getMessage())));
}
} catch (Exception $exception) {
OCP\Util::writeLog('files_sharing',"Unexpected Error : ".$exception->getMessage(),OCP\Util::ERROR);
echo "false";
} else {
OCP\Util::writeLog('files_sharing', 'File does not exist or is not readable :'.$source, OCP\Util::ERROR);
OCP\JSON::error(array('data' => array('message' => 'File does not exist or is not readable')));
}
}

View File

@ -1,12 +1,13 @@
<?php
//$RUNTIME_NOAPPS = true;
OCP\JSON::checkAppEnabled('files_sharing');
require_once(OC::$APPSROOT . '/apps/files_sharing/lib_share.php');
$source = "/".OCP\USER::getUser()."/files".$_GET['source'];
$uid_shared_with = $_GET['uid_shared_with'];
OCP\JSON::checkAppEnabled('files_sharing');
OCP\JSON::checkLoggedIn();
$source = '/'.OCP\USER::getUser().'/files'.$_POST['source'];
$uid_shared_with = $_POST['uid_shared_with'];
OC_Share::unshare($source, $uid_shared_with);
OCP\JSON::success();
?>

View File

@ -1,7 +1,4 @@
<?php
//$RUNTIME_NOAPPS = true;
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('files_sharing');
@ -14,12 +11,17 @@ $users[] = "<optgroup label='Users'>";
$groups[] = "<optgroup label='Groups'>";
foreach ($userGroups as $group) {
$groupUsers = OC_Group::usersInGroup($group);
$userCount = 0;
foreach ($groupUsers as $user) {
if ($user != $self) {
$users[] = "<option value='".$user."'>".$user."</option>";
$userCount++;
}
}
$groups[] = "<option value='".$group."'>".$group."</option>";
// Don't include the group if only the current user is a member of it
if ($userCount > 0) {
$groups[] = "<option value='".$group."(group)'>".$group." (group) </option>";
}
}
$users[] = "</optgroup>";
$groups[] = "</optgroup>";

View File

@ -6,8 +6,9 @@
-moz-box-shadow:0 1px 1px #777; -webkit-box-shadow:0 1px 1px #777; box-shadow:0 1px 1px #777;
-moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em;
-moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
#shared_list { padding:0.5em; list-style-type: none; }
#public { border-top:1px solid #ddd; padding-top:0.5em; }
#sharedWithList { padding:0.5em; list-style-type: none; }
#privateLink { border-top:1px solid #ddd; padding-top:0.5em; }
a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; }
a.unshare:hover { opacity:1; }
#share_with { width: 16em; }
#privateLink label, .edit { font-weight:normal; }

View File

@ -17,7 +17,7 @@ if ($source !== false) {
$source .= $subPath;
if (!OC_Filesystem::file_exists($source)) {
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template("", "404", "guest");
$tmpl = new OCP\Template("", "404", "guest");
$tmpl->assign("file", $subPath);
$tmpl->printPage();
exit;
@ -49,15 +49,15 @@ if ($source !== false) {
}
// Load the files we need
OCP\Util::addStyle("files", "files");
$breadcrumbNav = new OC_Template("files", "part.breadcrumb", "");
$breadcrumbNav = new OCP\Template("files", "part.breadcrumb", "");
$breadcrumbNav->assign("breadcrumb", $breadcrumb);
$breadcrumbNav->assign("baseURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$list = new OC_Template("files", "part.list", "");
$list = new OCP\Template("files", "part.list", "");
$list->assign("files", $files);
$list->assign("baseURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$list->assign("downloadURL", OCP\Util::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$list->assign("readonly", true);
$tmpl = new OC_Template("files", "index", "user");
$tmpl = new OCP\Template("files", "index", "user");
$tmpl->assign("fileList", $list->fetchPage());
$tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
$tmpl->assign("readonly", true);
@ -78,7 +78,7 @@ if ($source !== false) {
}
} else {
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template("", "404", "guest");
$tmpl = new OCP\Template("", "404", "guest");
$tmpl->printPage();
die();
}

View File

@ -1,100 +1,276 @@
$(document).ready(function() {
var shared_status = {};
if (typeof FileActions !== 'undefined') {
FileActions.register('all', 'Share', function(filename) {
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
var icon;
if (typeof filename == 'undefined') {
return false;
}
var file = $('#dir').val()+'/'+filename;
if(shared_status[file])
return shared_status[file].icon;
$.ajax({
type: 'GET',
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
dataType: 'json',
data: {source: file},
async: false,
success: function(users) {
if (users) {
icon = OC.imagePath('core', 'actions/shared');
$.each(users, function(index, row) {
if (row.uid_shared_with == 'public') {
icon = OC.imagePath('core', 'actions/public');
}
});
OC.Share={
icons:[],
itemUsers:[],
itemGroups:[],
itemPrivateLink:false,
usersAndGroups:[],
loadIcons:function() {
// Cache all icons for shared files
$.getJSON(OC.filePath('files_sharing', 'ajax', 'getstatuses.php'), function(result) {
if (result && result.status === 'success') {
$.each(result.data, function(item, hasPrivateLink) {
if (hasPrivateLink) {
OC.Share.icons[item] = OC.imagePath('core', 'actions/public');
} else {
icon = OC.imagePath('core', 'actions/share');
}
shared_status[file]= { timestamp: new Date().getTime(), icon: icon };
}
});
return icon;
}, function(filename) {
if (($('#dropdown').length > 0)) {
$('#dropdown').hide('blind', function() {
var dropdownFile = $('#dropdown').data('file')
var file = $('#dir').val()+'/'+filename;
$('#dropdown').remove();
$('tr').removeClass('mouseOver');
if (dropdownFile != file) {
createDropdown(filename, file);
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
}
});
}
});
},
loadItem:function(item) {
$.ajax({type: 'GET', url: OC.filePath('files_sharing', 'ajax', 'getitem.php'), data: { item: item }, async: false, success: function(result) {
if (result && result.status === 'success') {
var item = result.data;
OC.Share.itemUsers = item.users;
OC.Share.itemGroups = item.groups;
OC.Share.itemPrivateLink = item.privateLink;
}
}});
},
share:function(source, uid_shared_with, permissions, callback) {
$.post(OC.filePath('files_sharing', 'ajax', 'share.php'), { sources: source, uid_shared_with: uid_shared_with, permissions: permissions }, function(result) {
if (result && result.status === 'success') {
if (callback) {
callback(result.data);
}
} else {
createDropdown(filename, $('#dir').val()+'/'+filename);
OC.dialogs.alert(result.data.message, 'Error while sharing');
}
});
},
unshare:function(source, uid_shared_with, callback) {
$.post(OC.filePath('files_sharing', 'ajax', 'unshare.php'), { source: source, uid_shared_with: uid_shared_with }, function(result) {
if (result && result.status === 'success') {
if (callback) {
callback();
}
} else {
OC.dialogs.alert('Error', 'Error while unsharing');
}
});
},
changePermissions:function(source, uid_shared_with, permissions) {
$.post(OC.filePath('files_sharing','ajax','setpermissions.php'), { source: source, uid_shared_with: uid_shared_with, permissions: permissions }, function(result) {
if (!result || result.status !== 'success') {
OC.dialogs.alert('Error', 'Error while changing permissions');
}
});
},
showDropDown:function(item, appendTo) {
OC.Share.loadItem(item);
var html = '<div id="dropdown" class="drop" data-item="'+item+'">';
html += '<select data-placeholder="User or Group" id="share_with" class="chzen-select">';
html += '<option value=""></option>';
html += '</select>';
html += '<div id="sharedWithList">';
html += '<ul id="userList"></ul>';
html += '<div id="groups" style="display:none;">';
html += '<br />';
html += 'Groups: ';
html += '<ul id="groupList"></ul>';
html += '</div>';
html += '</div>';
html += '<div id="privateLink">';
html += '<input type="checkbox" name="privateLinkCheckbox" id="privateLinkCheckbox" value="1" /><label for="privateLinkCheckbox">Share with private link</label>';
html += '<br />';
html += '<input id="privateLinkText" style="display:none; width:90%;" />';
html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
html += '</div>';
$(html).appendTo(appendTo);
if (OC.Share.usersAndGroups.length < 1) {
$.getJSON(OC.filePath('files_sharing', 'ajax', 'userautocomplete.php'), function(users) {
if (users) {
OC.Share.usersAndGroups = users;
$.each(users, function(index, user) {
$(user).appendTo('#share_with');
});
$('#share_with').trigger('liszt:updated');
}
});
} else {
$.each(OC.Share.usersAndGroups, function(index, user) {
$(user).appendTo('#share_with');
});
$('#share_with').trigger('liszt:updated');
}
if (OC.Share.itemUsers) {
$.each(OC.Share.itemUsers, function(index, user) {
if (user.parentFolder) {
OC.Share.addSharedWith(user.uid, user.permissions, false, user.parentFolder);
} else {
OC.Share.addSharedWith(user.uid, user.permissions, false, false);
}
});
}
if (OC.Share.itemGroups) {
$.each(OC.Share.itemGroups, function(index, group) {
if (group.parentFolder) {
OC.Share.addSharedWith(group.gid, group.permissions, group.users, group.parentFolder);
} else {
OC.Share.addSharedWith(group.gid, group.permissions, group.users, false);
}
});
}
if (OC.Share.itemPrivateLink) {
OC.Share.showPrivateLink(item, OC.Share.itemPrivateLink);
}
$('#dropdown').show('blind');
$('#share_with').chosen();
},
hideDropDown:function(callback) {
$('#dropdown').hide('blind', function() {
$('#dropdown').remove();
if (callback) {
callback.call();
}
});
},
addSharedWith:function(uid_shared_with, permissions, isGroup, parentFolder) {
if (parentFolder) {
var sharedWith = '<li>Parent folder '+parentFolder+' shared with '+uid_shared_with+'</li>';
} else {
var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"');
var style = ((permissions == 0) ? 'style="display:none;"' : '');
var sharedWith = '<li data-uid_shared_with="'+uid_shared_with+'">';
sharedWith += '<a href="" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core','actions/delete')+'"/></a>';
sharedWith += uid_shared_with;
sharedWith += '<input type="checkbox" name="permissions" id="'+uid_shared_with+'" class="permissions" '+checked+' />';
sharedWith += '<label class="edit" for="'+uid_shared_with+'" '+style+'>can edit</label>';
sharedWith += '</li>';
}
if (isGroup) {
// Groups are added to a different list
$('#groups').show();
$(sharedWith).appendTo('#groupList');
// Remove group from select form
$('#share_with option[value="'+uid_shared_with+'(group)"]').remove();
$('#share_with').trigger('liszt:updated');
// Remove users in group from select form
$.each(isGroup, function(index, user) {
$('#share_with option[value="'+user+'"]').remove();
$('#share_with').trigger('liszt:updated');
});
} else {
$(sharedWith).appendTo('#userList');
// Remove user from select form
$('#share_with option[value="'+uid_shared_with+'"]').remove();
$('#share_with').trigger('liszt:updated');
}
},
removeSharedWith:function(uid_shared_with) {
var option;
if ($('#userList li[data-uid_shared_with="'+uid_shared_with+'"]').length > 0) {
$('#userList li[data-uid_shared_with="'+uid_shared_with+'"]').remove();
option = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</option>';
} else if ($('#groupList li[data-uid_shared_with="'+uid_shared_with+'"]').length > 0) {
$('#groupList li[data-uid_shared_with="'+uid_shared_with+'"]').remove();
if ($('#groupList li').length < 1) {
$('#groups').hide();
}
option = '<option value="'+uid_shared_with+'(group)">'+uid_shared_with+' (group)</option>';
}
$(option).appendTo('#share_with');
$('#share_with').trigger('liszt:updated');
},
showPrivateLink:function(item, token) {
$('#privateLinkCheckbox').attr('checked', true);
var link = parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token;
if (token.indexOf('&path=') == -1) {
link += '&file=' + item;
} else {
// Disable checkbox if inside a shared parent folder
$('#privateLinkCheckbox').attr('disabled', 'true');
}
$('#privateLinkText').val(link);
$('#privateLinkText').show('blind', function() {
$('#privateLinkText').after('<br id="emailBreak" />');
$('#email').show();
$('#emailButton').show();
});
},
hidePrivateLink:function() {
$('#privateLinkText').hide('blind');
$('#emailBreak').remove();
$('#email').hide();
$('#emailButton').hide();
},
emailPrivateLink:function() {
$('#email').css('font-weight', 'bold');
$('#email').animate({ fontWeight: 'normal' }, 2000, function() {
$(this).val('');
}).val('Email sent');
$.post(OC.filePath('files_sharing', 'ajax', 'email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val());
},
dirname:function(path) {
return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');
}
}
$(document).ready(function() {
OC.Share.loadIcons();
if (typeof FileActions !== 'undefined') {
FileActions.register('all', 'Share', function(filename) {
// Return the correct sharing icon
if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback
var item = $('#dir').val() + '/' + filename;
// Check if icon is in cache
if (OC.Share.icons[item]) {
return OC.Share.icons[item];
} else {
var last = '';
var path = OC.Share.dirname(item);
// Search for possible parent folders that are shared
while (path != last) {
if (OC.Share.icons[path]) {
OC.Share.icons[item] = OC.Share.icons[path];
return OC.Share.icons[item];
}
last = path;
path = OC.Share.dirname(path);
}
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
return OC.Share.icons[item];
}
}, function(filename) {
var file = $('#dir').val() + '/' + filename;
var appendTo = $('tr').filterAttr('data-file',filename).find('td.filename');
// Check if drop down is already visible for a different file
if (($('#dropdown').length > 0)) {
if (file != $('#dropdown').data('item')) {
OC.Share.hideDropDown(function () {
$('tr').removeClass('mouseOver');
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
OC.Share.showDropDown(file, appendTo);
});
}
} else {
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
OC.Share.showDropDown(file, appendTo);
}
});
};
$('.share').click(function(event) {
event.preventDefault();
event.stopPropagation();
var filenames = getSelectedFiles('name');
var length = filenames.length;
var files = '';
for (var i = 0; i < length; i++) {
files += $('#dir').val()+'/'+filenames[i]+';';
}
createDropdown(false, files);
});
$(this).click(function(event) {
if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) {
if ($('#dropdown').is(':visible')) {
delete shared_status[$('#dropdown').data('file')]; //Remove File from icon cache
$('#dropdown').hide('blind', function() {
$('#dropdown').remove();
OC.Share.hideDropDown(function() {
$('tr').removeClass('mouseOver');
});
}
}
});
$('#share_with').live('change', function() {
var source = $('#dropdown').data('file');
var uid_shared_with = $(this).val();
var permissions = 0;
var data = 'sources='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
$.ajax({
type: 'POST',
url: OC.linkTo('files_sharing','ajax/share.php'),
cache: false,
data: data,
success: function(result) {
if (result !== 'false') {
addUser(uid_shared_with, permissions, false);
}
}
});
});
$('#shared_list > li').live('mouseenter', function(event) {
$('#sharedWithList li').live('mouseenter', function(event) {
// Show permissions and unshare button
$(':hidden', this).show();
});
$('#shared_list > li').live('mouseleave', function(event) {
$('#sharedWithList li').live('mouseleave', function(event) {
// Hide permissions and unshare button
$('a', this).hide();
if (!$('input:[type=checkbox]', this).is(':checked')) {
$('input:[type=checkbox]', this).hide();
@ -102,161 +278,85 @@ $(document).ready(function() {
}
});
$('.permissions').live('change', function() {
var permissions = (this.checked) ? 1 : 0;
var source = $('#dropdown').data('file');
var uid_shared_with = $(this).parent().data('uid_shared_with');
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
$.ajax({
type: 'GET',
url: OC.linkTo('files_sharing','ajax/setpermissions.php'),
cache: false,
data: data
});
});
$('.unshare').live('click', function(event) {
event.preventDefault();
var user = $(this).parent();
var source = $('#dropdown').data('file');
var uid_shared_with = user.data('uid_shared_with');
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with);
$.ajax({
type: 'GET',
url: OC.linkTo('files_sharing','ajax/unshare.php'),
cache: false,
data: data,
success: function() {
var option = '<option value="'+uid_shared_with+'">'+uid_shared_with+'</option>';
$(user).remove();
$(option).appendTo('#share_with');
$('#share_with').trigger('liszt:updated');
$('#share_with').live('change', function() {
var item = $('#dropdown').data('item');
var uid_shared_with = $(this).val();
var pos = uid_shared_with.indexOf('(group)');
var isGroup = false;
if (pos != -1) {
// Remove '(group)' from uid_shared_with
uid_shared_with = uid_shared_with.substr(0, pos);
isGroup = true;
}
OC.Share.share(item, uid_shared_with, 0, function() {
if (isGroup) {
// Reload item because we don't know which users are in the group
OC.Share.loadItem(item);
var users;
$.each(OC.Share.itemGroups, function(index, group) {
if (group.gid == uid_shared_with) {
users = group.users;
}
});
OC.Share.addSharedWith(uid_shared_with, 0, users, false);
} else {
OC.Share.addSharedWith(uid_shared_with, 0, false, false);
}
// Change icon
if (!OC.Share.itemPrivateLink) {
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
}
});
});
$('#makelink').live('change', function() {
$('.unshare').live('click', function() {
var item = $('#dropdown').data('item');
var uid_shared_with = $(this).parent().data('uid_shared_with');
OC.Share.unshare(item, uid_shared_with, function() {
OC.Share.removeSharedWith(uid_shared_with);
// Reload item to update cached users and groups for the icon check
OC.Share.loadItem(item);
// Change icon
if (!OC.Share.itemPrivateLink && !OC.Share.itemUsers && !OC.Share.itemGroups) {
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
}
});
});
$('.permissions').live('change', function() {
var permissions = (this.checked) ? 1 : 0;
OC.Share.changePermissions($('#dropdown').data('item'), $(this).parent().data('uid_shared_with'), permissions);
});
$('#privateLinkCheckbox').live('change', function() {
var item = $('#dropdown').data('item');
if (this.checked) {
var source = $('#dropdown').data('file');
var uid_shared_with = 'public';
var permissions = 0;
var data = 'sources='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with)+'&permissions='+encodeURIComponent(permissions);
$.ajax({
type: 'POST',
url: OC.linkTo('files_sharing','ajax/share.php'),
cache: false,
data: data,
success: function(token) {
if (token) {
showPublicLink(token, source.substr(source.lastIndexOf('/')));
}
}
// Create a private link
OC.Share.share(item, 'public', 0, function(token) {
OC.Share.showPrivateLink(item, token);
// Change icon
OC.Share.icons[item] = OC.imagePath('core', 'actions/public');
});
} else {
var source = $('#dropdown').data('file');
var uid_shared_with = 'public';
var data = 'source='+encodeURIComponent(source)+'&uid_shared_with='+encodeURIComponent(uid_shared_with);
$.ajax({
type: 'GET',
url: OC.linkTo('files_sharing','ajax/unshare.php'),
cache: false,
data: data,
success: function(){
$('#link').hide('blind');
$('#emailBreak').remove();
$('#email').hide('blind');
$('#emailButton').hide('blind');
// Delete private link
OC.Share.unshare(item, 'public', function() {
OC.Share.hidePrivateLink();
// Change icon
if (OC.Share.itemUsers || OC.Share.itemGroups) {
OC.Share.icons[item] = OC.imagePath('core', 'actions/shared');
} else {
OC.Share.icons[item] = OC.imagePath('core', 'actions/share');
}
});
}
});
$('#link').live('click', function() {
$('#privateLinkText').live('click', function() {
$(this).focus();
$(this).select();
});
$('#emailButton').live('click', function() {
$('#email').css('font-weight', 'bold');
$('#email').animate({ fontWeight: 'normal' }, 2000, function() {
$(this).val('');
}).val('Email sent');
$.post(OC.filePath('files_sharing','ajax','email.php'), 'toaddress='+$('#email').val()+'&link='+$('#link').val());
OC.Share.emailPrivateLink();
});
});
function createDropdown(filename, files) {
var html = '<div id="dropdown" class="drop" data-file="'+files+'">';
html += '<div id="private">';
html += '<select data-placeholder="User or Group" id="share_with" class="chzen-select">';
html += '<option value=""></option>';
html += '</select>';
html += '<ul id="shared_list"></ul>';
html += '</div>';
html += '<div id="public">';
html += '<input type="checkbox" name="makelink" id="makelink" value="1" /><label for="makelink">Share with private link</label>';
//html += '<input type="checkbox" name="public_link_write" id="public_link_write" value="1" /><label for="public_link_write">allow upload</label>';
html += '<br />';
html += '<input id="link" style="display:none; width:90%;" />';
html += '<input id="email" style="display:none; width:65%;" value="" placeholder="Email link to person" />';
html += '<input id="emailButton" style="display:none;" type="submit" value="Send" />';
html += '</div>';
if (filename) {
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
} else {
$(html).appendTo($('thead .share'));
}
$.getJSON(OC.linkTo('files_sharing', 'ajax/userautocomplete.php'), function(users) {
if (users) {
$.each(users, function(index, row) {
$(row).appendTo('#share_with');
});
$('#share_with').trigger('liszt:updated');
}
});
$.getJSON(OC.linkTo('files_sharing', 'ajax/getitem.php'), { source: files }, function(users) {
if (users) {
$.each(users, function(index, row) {
if (row.uid_shared_with == 'public') {
showPublicLink(row.token, '/'+filename);
} else if (isNaN(index)) {
addUser(row.uid_shared_with, row.permissions, index.substr(0, index.lastIndexOf('-')));
} else {
addUser(row.uid_shared_with, row.permissions, false);
}
});
}
});
$('#dropdown').show('blind');
$('#share_with').chosen();
}
function addUser(uid_shared_with, permissions, parentFolder) {
if (parentFolder) {
var user = '<li>Parent folder '+parentFolder+' shared with '+uid_shared_with+'</li>';
} else {
var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"');
var style = ((permissions == 0) ? 'style="display:none;"' : '');
var user = '<li data-uid_shared_with="'+uid_shared_with+'">';
user += '<a href="" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core','actions/delete')+'"/></a>';
user += uid_shared_with;
user += '<input type="checkbox" name="permissions" id="'+uid_shared_with+'" class="permissions" '+checked+' />';
user += '<label for="'+uid_shared_with+'" '+style+'>can edit</label>';
user += '</li>';
}
$('#share_with option[value="'+uid_shared_with+'"]').remove();
$('#share_with').trigger('liszt:updated');
$(user).appendTo('#shared_list');
}
function showPublicLink(token, file) {
$('#makelink').attr('checked', true);
$('#link').data('token', token);
$('#link').val(parent.location.protocol+'//'+location.host+OC.linkTo('files_sharing','get.php')+'?token='+token+'&f='+file);
$('#link').show('blind', function() {
$('#link').after('<br id="emailBreak" />');
$('#email').show('blind');
$('#emailButton').show('blind');
});
}
});

View File

@ -69,7 +69,7 @@ class OC_Share {
}
foreach ($uid_shared_with as $uid) {
// Check if this item is already shared with the user
$checkSource = OCP\DB::prepare("SELECT source FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with ".self::getUsersAndGroups($uid));
$checkSource = OCP\DB::prepare("SELECT source FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with ".self::getUsersAndGroups($uid, false));
$resultCheckSource = $checkSource->execute(array($source))->fetchAll();
// TODO Check if the source is inside a folder
if (count($resultCheckSource) > 0 && !isset($gid)) {
@ -98,15 +98,8 @@ class OC_Share {
$uid = $uid."@".$gid;
}
$query->execute(array($uid_owner, $uid, $source, $target, $permissions));
// Add file to filesystem cache
$userDirectory = "/".OCP\USER::getUser()."/files";
$data = OC_Filecache::get(substr($source, strlen($userDirectory)));
$parentQuery = OCP\DB::prepare('SELECT id FROM *PREFIX*fscache WHERE path=?');
$parentResult = $parentQuery->execute(array($sharedFolder))->fetchRow();
$parent = $parentResult['id'];
$is_writeable = $permissions & OC_Share::WRITE;
$cacheQuery = OCP\DB::prepare('INSERT INTO *PREFIX*fscache(parent, name, path, size, mtime, ctime, mimetype, mimepart, user, writable) VALUES(?,?,?,?,?,?,?,?,?,?)');
$cacheQuery->execute(array($parent, basename($target), $target, $data['size'], $data['mtime'], $data['ctime'], $data['mimetype'], dirname($data['mimetype']), $uid, $is_writeable));
// Update mtime of shared folder to invoke a file cache rescan
OC_Filesystem::getStorage($sharedFolder)->touch($sharedFolder);
}
}
}
@ -125,7 +118,7 @@ class OC_Share {
* @param $uid (Optional) The uid to get the user groups for, a gid to get the users in a group, or if not set the current user
* @return An IN operator as a string
*/
private static function getUsersAndGroups($uid = null) {
private static function getUsersAndGroups($uid = null, $includePrivateLinks = true) {
$in = " IN(";
if (isset($uid) && OC_Group::groupExists($uid)) {
$users = OC_Group::usersInGroup($uid);
@ -152,7 +145,9 @@ class OC_Share {
$in .= ", '".$uid."@".$group."'";
}
}
$in .= ", '".self::PUBLICLINK."'";
if ($includePrivateLinks) {
$in .= ", '".self::PUBLICLINK."'";
}
$in .= ")";
return $in;
}
@ -381,6 +376,9 @@ class OC_Share {
$source = self::cleanPath($source);
$query = OCP\DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_owner = ? AND uid_shared_with ".self::getUsersAndGroups($uid_shared_with));
$query->execute(array(strlen($source), $source, OCP\USER::getUser()));
// Update mtime of shared folder to invoke a file cache rescan
$sharedFolder = '/'.$uid_shared_with.'/files/Shared';
OC_Filesystem::getStorage($sharedFolder)->touch($sharedFolder);
}
/**

View File

@ -30,7 +30,7 @@ OCP\App::setActiveNavigationEntry("files_sharing_list");
OCP\Util::addscript("files_sharing", "list");
$tmpl = new OC_Template("files_sharing", "list", "user");
$tmpl = new OCP\Template("files_sharing", "list", "user");
$tmpl->assign("shared_items", OC_Share::getMySharedItems());
$tmpl->printPage();

View File

@ -2,7 +2,7 @@
OCP\User::checkAdminUser();
OCP\Util::addscript('files_sharing', 'settings');
$tmpl = new OC_Template('files_sharing', 'settings');
$tmpl = new OCP\Template('files_sharing', 'settings');
$tmpl->assign('allowResharing', OCP\Config::getAppValue('files_sharing', 'resharing', 'yes'));
return $tmpl->fetchPage();

View File

@ -24,7 +24,7 @@ require_once( '../../lib/base.php' );
OCP\User::checkLoggedIn( );
OCP\Util::addStyle('files_versions','versions');
$tmpl = new OC_Template( 'files_versions', 'history', 'user' );
$tmpl = new OCP\Template( 'files_versions', 'history', 'user' );
if ( isset( $_GET['path'] ) ) {

View File

@ -4,7 +4,7 @@ OCP\User::checkAdminUser();
OCP\Util::addscript( 'files_versions', 'versions' );
$tmpl = new OC_Template( 'files_versions', 'settings');
$tmpl = new OCP\Template( 'files_versions', 'settings');
return $tmpl->fetchPage();
?>

View File

@ -6,5 +6,6 @@
<author>Bartek Przybylski</author>
<require>2</require>
<description>Dedicated pictures application</description>
<standalone/>
<default_enable/>
</info>

View File

@ -38,7 +38,7 @@ if (!isset($_GET['view'])) {
while ($row = $result->fetchRow())
$r[] = $row;
$tmpl = new OC_Template( 'gallery', 'index', 'user' );
$tmpl = new OCP\Template( 'gallery', 'index', 'user' );
$tmpl->assign('r', $r);
$tmpl->printPage();
} else {
@ -48,7 +48,7 @@ if (!isset($_GET['view'])) {
while ($p = $result->fetchRow())
$photos[] = $p['file_path'];
$tmpl = new OC_Template( 'gallery', 'view_album', 'user' );
$tmpl = new OCP\Template( 'gallery', 'view_album', 'user' );
$tmpl->assign('photos', $photos);
$tmpl->assign('albumName', $_GET['view']);
$tmpl->printPage();

View File

@ -6,5 +6,6 @@
<licence>AGPL</licence>
<author>Robin Appelman</author>
<require>2</require>
<standalone/>
<default_enable/>
</info>

View File

@ -41,7 +41,7 @@ OCP\Util::addStyle('media','music');
OCP\App::setActiveNavigationEntry( 'media_index' );
$tmpl = new OC_Template( 'media', 'music', 'user' );
$tmpl = new OCP\Template( 'media', 'music', 'user' );
$tmpl->printPage();
?>

2
apps/media/settings.php Normal file → Executable file
View File

@ -1,6 +1,6 @@
<?php
$tmpl = new OC_Template( 'media', 'settings');
$tmpl = new OCP\Template( 'media', 'settings');
return $tmpl->fetchPage();
?>

12
apps/media/templates/music.php Normal file → Executable file
View File

@ -1,11 +1,11 @@
<div class='player-controls' id="controls">
<ul class="jp-controls">
<li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo image_path('core', 'actions/play-big.svg'); ?>" /></a></li>
<li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo image_path('core', 'actions/pause-big.svg'); ?>" /></a></li>
<li><a href="#" class="jp-previous action"><img class="svg" alt="<?php echo $l->t('Previous');?>" src="<?php echo image_path('core', 'actions/play-previous.svg'); ?>" /></a></li>
<li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo image_path('core', 'actions/play-next.svg'); ?>" /></a></li>
<li><a href="#" class="jp-mute action"><img class="svg" alt="<?php echo $l->t('Mute');?>" src="<?php echo image_path('core', 'actions/sound.svg'); ?>" /></a></li>
<li><a href="#" class="jp-unmute action"><img class="svg" alt="<?php echo $l->t('Unmute');?>" src="<?php echo image_path('core', 'actions/sound-off.svg'); ?>" /></a></li>
<li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo OCP\image_path('core', 'actions/play-big.svg'); ?>" /></a></li>
<li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo OCP\image_path('core', 'actions/pause-big.svg'); ?>" /></a></li>
<li><a href="#" class="jp-previous action"><img class="svg" alt="<?php echo $l->t('Previous');?>" src="<?php echo OCP\image_path('core', 'actions/play-previous.svg'); ?>" /></a></li>
<li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo OCP\image_path('core', 'actions/play-next.svg'); ?>" /></a></li>
<li><a href="#" class="jp-mute action"><img class="svg" alt="<?php echo $l->t('Mute');?>" src="<?php echo OCP\image_path('core', 'actions/sound.svg'); ?>" /></a></li>
<li><a href="#" class="jp-unmute action"><img class="svg" alt="<?php echo $l->t('Unmute');?>" src="<?php echo OCP\image_path('core', 'actions/sound-off.svg'); ?>" /></a></li>
</ul>
<div class="jp-progress">
<div class="jp-seek-bar">

8
apps/media/templates/player.php Normal file → Executable file
View File

@ -1,7 +1,7 @@
<?php
if(!isset($_)){//allow the template to be loaded standalone
require_once '../../../lib/base.php';
$tmpl = new OC_Template( 'media', 'player');
$tmpl = new OCP\Template( 'media', 'player');
$tmpl->printPage();
exit;
}
@ -10,8 +10,8 @@ if(!isset($_)){//allow the template to be loaded standalone
<div class='player-controls' id="playercontrols">
<div class="player" id="jp-player"></div>
<ul class="jp-controls">
<li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo image_path('core', 'actions/play.svg'); ?>" /></a></li>
<li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo image_path('core', 'actions/pause.svg'); ?>" /></a></li>
<li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo image_path('core', 'actions/play-next.svg'); ?>" /></a></li>
<li><a href="#" class="jp-play action"><img class="svg" alt="<?php echo $l->t('Play');?>" src="<?php echo OCP\image_path('core', 'actions/play.svg'); ?>" /></a></li>
<li><a href="#" class="jp-pause action"><img class="svg" alt="<?php echo $l->t('Pause');?>" src="<?php echo OCP\image_path('core', 'actions/pause.svg'); ?>" /></a></li>
<li><a href="#" class="jp-next action"><img class="svg" alt="<?php echo $l->t('Next');?>" src="<?php echo OCP\image_path('core', 'actions/play-next.svg'); ?>" /></a></li>
</ul>
</div>

2
apps/remoteStorage/settings.php Normal file → Executable file
View File

@ -1,7 +1,7 @@
<?php
require_once('lib_remoteStorage.php');
$tmpl = new OC_Template( 'remoteStorage', 'settings');
$tmpl = new OCP\Template( 'remoteStorage', 'settings');
return $tmpl->fetchPage();
?>

2
apps/tasks/ajax/addtaskform.php Normal file → Executable file
View File

@ -8,7 +8,7 @@ $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
$category_options = OC_Calendar_App::getCategoryOptions();
$percent_options = range(0, 100, 10);
$priority_options = OC_Task_App::getPriorityOptions();
$tmpl = new OC_Template('tasks','part.addtaskform');
$tmpl = new OCP\Template('tasks','part.addtaskform');
$tmpl->assign('calendars',$calendars);
$tmpl->assign('category_options', $category_options);
$tmpl->assign('percent_options', $percent_options);

2
apps/tasks/ajax/edittask.php Normal file → Executable file
View File

@ -19,7 +19,7 @@ OC_Task_App::updateVCalendarFromRequest($_POST, $vcalendar);
OC_Calendar_Object::edit($id, $vcalendar->serialize());
$priority_options = OC_Task_App::getPriorityOptions();
$tmpl = new OC_Template('tasks','part.details');
$tmpl = new OCP\Template('tasks','part.details');
$tmpl->assign('priority_options', $priority_options);
$tmpl->assign('details', $vcalendar->VTODO);
$tmpl->assign('id', $id);

2
apps/tasks/ajax/edittaskform.php Normal file → Executable file
View File

@ -12,7 +12,7 @@ $category_options = OC_Calendar_App::getCategoryOptions();
$percent_options = range(0, 100, 10);
$priority_options = OC_Task_App::getPriorityOptions();
$tmpl = new OC_Template('tasks','part.edittaskform');
$tmpl = new OCP\Template('tasks','part.edittaskform');
$tmpl->assign('category_options', $category_options);
$tmpl->assign('percent_options', $percent_options);
$tmpl->assign('priority_options', $priority_options);

2
apps/tasks/ajax/getdetails.php Normal file → Executable file
View File

@ -15,7 +15,7 @@ if (!$details){
}
$priority_options = OC_Task_App::getPriorityOptions();
$tmpl = new OC_Template('tasks','part.details');
$tmpl = new OCP\Template('tasks','part.details');
$tmpl->assign('priority_options', $priority_options);
$tmpl->assign('details',$details->VTODO);
$tmpl->assign('id',$id);

2
apps/tasks/index.php Normal file → Executable file
View File

@ -28,7 +28,7 @@ OCP\App::setActiveNavigationEntry('tasks_index');
$categories = OC_Calendar_App::getCategoryOptions();
$l10n = new OC_L10N('tasks');
$priority_options = OC_Task_App::getPriorityOptions();
$output = new OC_Template('tasks', 'tasks', 'user');
$output = new OCP\Template('tasks', 'tasks', 'user');
$output->assign('priority_options', $priority_options);
$output->assign('categories', $categories);
$output -> printPage();

2
apps/tasks/templates/part.taskform.php Normal file → Executable file
View File

@ -6,7 +6,7 @@
<br>
<label for="categories"><?php echo $l->t('Categories'); ?></label>
<input id="categories" name="categories" type="text" placeholder="<?php echo $l->t('Separate categories with commas'); ?>" value="<?php echo isset($_['categories']) ? htmlspecialchars($_['categories']) : '' ?>">
<a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a>
<a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"><img alt="<?php echo $l->t('Edit categories'); ?>" src="<?php echo OCP\image_path('core','actions/rename.svg')?>" class="svg action" style="width: 16px; height: 16px;"></a>
<br>
<label for="due"><?php echo $l->t('Due'); ?></label>
<input type="text" id="due" name="due" placeholder="<?php echo $l->t('Due date') ?>" value="<?php echo isset($_['details']->DUE) ? $l->l('datetime', $_['details']->DUE[0]->getDateTime()) : '' ?>">

6
apps/tasks/templates/tasks.php Normal file → Executable file
View File

@ -17,13 +17,13 @@
</div>
<p id="task_actions_template" class="task_actions">
<!-- span class="task_star">
<img title="<?php echo $l->t('Important') ?>" src="<?php echo image_path('core', 'actions/add.svg') ?>" class="svg"><?php echo $l->t('Important') ?>
<img title="<?php echo $l->t('Important') ?>" src="<?php echo OCP\image_path('core', 'actions/add.svg') ?>" class="svg"><?php echo $l->t('Important') ?>
</span -->
<span class="task_more">
<img title="<?php echo $l->t('More') ?>" src="<?php echo image_path('core', 'actions/triangle-s.svg') ?>" class="svg"><?php echo $l->t('More') ?>
<img title="<?php echo $l->t('More') ?>" src="<?php echo OCP\image_path('core', 'actions/triangle-s.svg') ?>" class="svg"><?php echo $l->t('More') ?>
</span>
<span class="task_less">
<img title="<?php echo $l->t('Less') ?>" src="<?php echo image_path('core', 'actions/triangle-n.svg') ?>" class="svg"><?php echo $l->t('Less') ?>
<img title="<?php echo $l->t('Less') ?>" src="<?php echo OCP\image_path('core', 'actions/triangle-n.svg') ?>" class="svg"><?php echo $l->t('Less') ?>
</span>
</p>
<script type='text/javascript'>

View File

@ -41,7 +41,7 @@ if ($_POST) {
}
// fill template
$tmpl = new OC_Template( 'user_ldap', 'settings');
$tmpl = new OCP\Template( 'user_ldap', 'settings');
foreach($params as $param){
$value = OCP\Config::getAppValue('user_ldap', $param,'');
$tmpl->assign($param, $value);

View File

@ -38,14 +38,14 @@ if (isset($_POST['user_import'])) {
if( !move_uploaded_file( $from, $to ) ){
$error = array('error'=>'Failed to move the uploaded file','hint'=>'Try checking the permissions of the '.get_temp_dir().' dir.');
OCP\Util::writeLog( 'user_migrate', "Failed to copy the uploaded file", OCP\Util::ERROR );
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
$tmpl->assign('error',$error);
return $tmpl->fetchPage();
}
$response = json_decode( OC_Migrate::import( $to, 'user' ) );
if( !$response->success ){
$error = array('error'=>'There was an error while importing the user!','hint'=>'Please check the logs for a more detailed explaination');
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
$tmpl->assign('error',$error);
return $tmpl->fetchPage();
} else {
@ -64,24 +64,24 @@ if (isset($_POST['user_import'])) {
if( isset( $notsupported ) || isset( $failed ) ){
if( count( $failed ) > 0 ){
$error = array('error'=>'Some app data failed to import','hint'=>'App data for: '.implode(', ', $failed).' failed to import.');
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
$tmpl->assign('error',$error);
return $tmpl->fetchPage();
} else if( count( $notsupported ) > 0 ){
$error = array('error'=>'Some app data could not be imported, as the apps are not installed on this instance','hint'=>'App data for: '.implode(', ', $notsupported).' failed to import as they were not found. Please install the apps and try again');
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
$tmpl->assign('error',$error);
return $tmpl->fetchPage();
}
} else {
// Went swimmingly!
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
return $tmpl->fetchPage();
}
}
} else {
// fill template
$tmpl = new OC_Template('user_migrate', 'admin');
$tmpl = new OCP\Template('user_migrate', 'admin');
return $tmpl->fetchPage();
}

Some files were not shown because too many files have changed in this diff Show More