Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move help articles file into the data directory #1900

Merged
merged 15 commits into from Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Expand Up @@ -42,6 +42,8 @@ RUN \
php5-json \
php5-mysql \
php5-xml \
php5-zip \
php5-openssl \
php5-curl \
curl \
php5-opcache \
Expand Down
6 changes: 3 additions & 3 deletions mod/file_tools/lib/functions.php
Expand Up @@ -245,7 +245,7 @@ function file_tools_get_child($folders, $depth = 0, $folder_guid, $removed) {
*/
function file_tools_build_widget_options($folder, $internalname = "", $selected = array()) {
$result = "";

$lang = get_current_language();
if (is_array($folder) && !array_key_exists("children", $folder)) {
foreach ($folder as $folder_item) {
$result .= "<ul>";
Expand All @@ -257,9 +257,9 @@ function file_tools_build_widget_options($folder, $internalname = "", $selected

$result .= "<li>";
if (in_array($folder_item->getGUID(), $selected)) {
$result .= "<input type='checkbox' name='" . $internalname . "' value='" . $folder_item->getGUID() . "' checked='checked'> " . $folder_item->title;
$result .= "<input type='checkbox' id='" . $folder_item->getGUID() . "' name='" . $internalname . "' value='" . $folder_item->getGUID() . "' checked='checked'> <label style='display:inline-block' for='" . $folder_item->getGUID() . "'>" . gc_explode_translation($folder_item->title, $lang).'</label>';
} else {
$result .= "<input type='checkbox' name='" . $internalname . "' value='" . $folder_item->getGUID() . "'> " . $folder_item->title;
$result .= "<input type='checkbox' id='" . $folder_item->getGUID() . "' name='" . $internalname . "' value='" . $folder_item->getGUID() . "'> <label style='display:inline-block' for='" . $folder_item->getGUID() . "'>" . gc_explode_translation($folder_item->title,$lang).'</label>';
}

if (!empty($folder["children"])) {
Expand Down
2 changes: 1 addition & 1 deletion mod/freshdesk_help/actions/articles/pedia-save.php
@@ -1,5 +1,5 @@
<?php
$myFile = "pedia-articles.json";
$myFile = "/sites/gccollab_data/freshdesk_help/pedia-articles.json";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_POST["html"];
fwrite($fh, $stringData);
Expand Down
2 changes: 1 addition & 1 deletion mod/freshdesk_help/actions/articles/save.php
@@ -1,5 +1,5 @@
<?php
$myFile = "articles.json";
$myFile = "/sites/gccollab_data/freshdesk_help/articles.json";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_POST["html"];
fwrite($fh, $stringData);
Expand Down
2 changes: 1 addition & 1 deletion mod/freshdesk_help/views/default/freshdesk/embed.php
Expand Up @@ -16,7 +16,7 @@
<?php
echo '<div id="article-search-tab" class="tab-pane active">';
//retrieve articles
$str = file_get_contents(get_site_by_url().'mod/freshdesk_help/actions/articles/pedia-articles.json');
$str = file_get_contents(elgg_get_config("dataroot").'freshdesk_help/pedia-articles.json');
if($str){
$articles = json_decode($str, true);

Expand Down
2 changes: 1 addition & 1 deletion mod/freshdesk_help/views/default/freshdesk/knowledge.php
Expand Up @@ -9,7 +9,7 @@
<?php
echo '<div id="article-search-tab" class="tab-pane active">';
//retrieve articles
$str = file_get_contents(get_site_by_url().'mod/freshdesk_help/actions/articles/articles.json');
$str = file_get_contents(elgg_get_config("dataroot").'freshdesk_help/articles.json');
if($str){
$articles = json_decode($str, true);

Expand Down
6 changes: 6 additions & 0 deletions mod/gc_mobile_api/models/blog.php
Expand Up @@ -168,6 +168,12 @@ function get_blogpost($user, $guid, $lang)
if (!isset($entity)) {
return "Blog was not found. Please try a different GUID";
}
if (!$entity) {
return "Blog was not found.";
}
if (!elgg_instanceof($entity, 'object', 'blog')) {
return "Invalid blog.";
}

if (!elgg_is_logged_in()) {
login($user_entity);
Expand Down
2 changes: 1 addition & 1 deletion mod/gc_mobile_api/models/bookmark.php
Expand Up @@ -81,7 +81,7 @@ function get_bookmark($user, $guid, $lang)

$entity = get_entity($guid);
if (!$entity) {
return "Event was not found. Please try a different GUID";
return "Bookmark was not found. Please try a different GUID";
}
//check if entity is bookmark? subtype bookmarks

Expand Down
11 changes: 11 additions & 0 deletions mod/gc_mobile_api/models/group.php
Expand Up @@ -604,7 +604,18 @@ function get_group_discussions($user, $guid, $limit, $offset, $lang)

$discussions = json_decode($discussions);
foreach ($discussions as $discussion) {
$likes = elgg_get_annotations(array(
'guid' => $discussion->guid,
'annotation_name' => 'likes'
));
$discussion->likes = count($likes);

$liked = elgg_get_annotations(array(
'guid' => $discussion->guid,
'annotation_owner_guid' => $user_entity->guid,
'annotation_name' => 'likes'
));
$discussion->liked = count($liked) > 0;
$discussion->userDetails = get_user_block($discussion->owner_guid, $lang);
$discussion->title = gc_explode_translation($discussion->title, $lang);
$discussion->description = gc_explode_translation($discussion->description, $lang);
Expand Down
32 changes: 15 additions & 17 deletions mod/loginrequired/views/default/groups/edit/access.php
Expand Up @@ -89,34 +89,32 @@
<?php

if ($entity && ($owner_guid == elgg_get_logged_in_user_guid() || elgg_is_admin_logged_in())) {
$members = array();

$options = array(
"relationship" => "member",
"relationship_guid" => $entity->getGUID(),
"inverse_relationship" => true,
"type" => "user",
"limit" => 0,
);

$batch = new ElggBatch("elgg_get_entities_from_relationship", $options);
foreach ($batch as $member) {
$option_text = "$member->name (@$member->username)";
$members[$member->guid] = htmlspecialchars($option_text, ENT_QUOTES, "UTF-8", false);
}
$members[$owner_guid] = get_entity($owner_guid)->name ." (@". get_entity($owner_guid)->username .")";
?>

<div class="form-group">
<label for="groups-owner-guid"><?php echo elgg_echo("groups:owner"); ?></label>
<?php
echo elgg_view("input/text", array(
"id" => "groups-owner-guid",
"value" => get_entity($owner_guid)->name,
));

echo elgg_view("input/select", array(
"name" => "owner_guid",
"id" => "groups-owner-guid",
"id" => "groups-owner-guid-select",
"value" => $owner_guid,
"options_values" => $members,
"class" => "groups-owner-input",
"class" => "groups-owner-input hidden",
));

$vars = array(
'class' => 'mentions-popup hidden',
'id' => 'groupmems-popup',
);

echo elgg_view_module('popup', '', elgg_view('graphics/ajax_loader', array('hidden' => false)), $vars);

if ($owner_guid == elgg_get_logged_in_user_guid()) {
echo "<span class='elgg-text-help'>" . elgg_echo("groups:owner:warning") . "</span>";
}
Expand Down
2 changes: 1 addition & 1 deletion mod/wet4/views/default/object/folder.php
Expand Up @@ -94,7 +94,7 @@
$title_en = elgg_view('output/url', $params_en);
$title_fr = elgg_view('output/url', $params_fr);

if( $description_json->en && $description_json->fr ){
if( $description_json->en && $description_json->fr && get_context() != 'widgets' ){
echo'<div id="change_language" class="change_language">';
if (get_current_language() == 'fr'){

Expand Down