瀏覽代碼

Change blog avatar from control panel

Bob Mottram 9 年之前
父節點
當前提交
280e9c604e
共有 1 個檔案被更改,包括 39 行新增15 行删除
  1. 39
    15
      src/freedombone-controlpanel

+ 39
- 15
src/freedombone-controlpanel 查看文件

631
     esac
631
     esac
632
 }
632
 }
633
 
633
 
634
+function change_blog_avatar {
635
+    data=$(tempfile 2>/dev/null)
636
+    trap "rm -f $data" 0 1 2 5 15
637
+    dialog --title $"Change blog avatar" \
638
+           --backtitle $"Freedombone Control Panel" \
639
+           --inputbox $"Enter a URL for an image. It should be approximately a square image." 8 75 2>$data
640
+    sel=$?
641
+    case $sel in
642
+        0)
643
+            IMAGE_URL=$(<$data)
644
+            if [ ${#IMAGE_URL} -gt 5 ]; then
645
+                clear
646
+                ${PROJECT_NAME}-blog -a $IMAGE_URL
647
+                if [ "$?" = "0" ]; then
648
+                    dialog --title $"Change blog avatar" \
649
+                           --msgbox $"Your blog avatar has been changed" 6 40
650
+                fi
651
+            fi          
652
+            ;;
653
+    esac
654
+}
655
+
634
 function change_ssh_public_key {
656
 function change_ssh_public_key {
635
     select_user
657
     select_user
636
     if [ ! $SELECTED_USERNAME ]; then
658
     if [ ! $SELECTED_USERNAME ]; then
1808
         trap "rm -f $data" 0 1 2 5 15
1830
         trap "rm -f $data" 0 1 2 5 15
1809
         dialog --backtitle $"Freedombone Control Panel" \
1831
         dialog --backtitle $"Freedombone Control Panel" \
1810
                --title $"Control Panel" \
1832
                --title $"Control Panel" \
1811
-               --radiolist $"Choose an operation:" 27 70 20 \
1833
+               --radiolist $"Choose an operation:" 28 70 21 \
1812
                1 $"About this system" off \
1834
                1 $"About this system" off \
1813
                2 $"Backup and Restore" off \
1835
                2 $"Backup and Restore" off \
1814
                3 $"Reset Tripwire" off \
1836
                3 $"Reset Tripwire" off \
1822
                11 $"Hubzilla" off \
1844
                11 $"Hubzilla" off \
1823
                12 $"Media menu" off \
1845
                12 $"Media menu" off \
1824
                13 $"IRC menu" off \
1846
                13 $"IRC menu" off \
1825
-               14 $"Change the name of this system" off \
1826
-               15 $"Set the TLS date/time source" off \
1827
-               16 $"Set a static local IP address" off \
1828
-               17 $"Check for updates" off \
1829
-               18 $"Power off the system" off \
1830
-               19 $"Restart the system" off \
1831
-               20 $"Exit" on 2> $data
1847
+               14 $"Change your blog avatar" off \
1848
+               15 $"Change the name of this system" off \
1849
+               16 $"Set the TLS date/time source" off \
1850
+               17 $"Set a static local IP address" off \
1851
+               18 $"Check for updates" off \
1852
+               19 $"Power off the system" off \
1853
+               20 $"Restart the system" off \
1854
+               21 $"Exit" on 2> $data
1832
         sel=$?
1855
         sel=$?
1833
         case $sel in
1856
         case $sel in
1834
             1) exit 1;;
1857
             1) exit 1;;
1848
             11) menu_hubzilla;;
1871
             11) menu_hubzilla;;
1849
             12) menu_media;;
1872
             12) menu_media;;
1850
             13) menu_irc;;
1873
             13) menu_irc;;
1851
-            14) change_system_name;;
1852
-            15) set_tls_time_source;;
1853
-            16) set_static_IP;;
1854
-            17) check_for_updates;;
1855
-            18) shut_down_system;;
1856
-            19) restart_system;;
1857
-            20) break;;
1874
+            14) change_blog_avatar;;
1875
+            15) change_system_name;;
1876
+            16) set_tls_time_source;;
1877
+            17) set_static_IP;;
1878
+            18) check_for_updates;;
1879
+            19) shut_down_system;;
1880
+            20) restart_system;;
1881
+            21) break;;
1858
         esac
1882
         esac
1859
     done
1883
     done
1860
 }
1884
 }